@MAPSTRUCT. No property named “packaging” exists in source parameter(s)

For those, who have the same issue when using mapstruct + lombok: I had the same issue. The reason was that I’ve been using Lombok plugin too. There’s no need to remove it, but you have to ensure that in pom.xml in <annotationProcessorPaths> Lombok tag is before the Mapstruct one. Example (part of pom.xml file): … Read more

Toggle between two classes in jQuery

How about $(YOUR_ELEMENT).live(“EVENT_NAME”, function() { $(“.portlet-header”).toggleClass(“ui-icon-plus”).toggleClass(“ui-icon-minus”); }); Even more shorter $(YOUR_ELEMENT).live(“EVENT_NAME”, function() { $(“.portlet-header”).toggleClass(“ui-icon-plus ui-icon-minus”); }); EDIT As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live(). jQuery API reference

Why duck typing is allowed for classes in TypeScript

This is the way structural typing works. Typescript has a structural type system to best emulate how Javscript works. Since Javascript uses duck typing, any object that defines the contract can be used in any function. Typescript just tries to validate duck typing at compile time instead of at runtime. Your problem will however only … Read more

Typescript class: “Overload signature is not compatible with function implementation”

You get that compilation error because the signature of the implementation function does not satisfy the empty constructor you declared. As you want to have the default constructor, it should be: class MyItem { public name: string; public surname: string; public category: string; public address: string; constructor(); constructor(name:string, surname: string, category: string, address?: string); constructor(name?: … Read more

Access parent class instance attribute from child class instance?

Parent is a class – blue print not an instance of it, in OOPS to access attributes of an object it requires instance of the same, Here self/child is instance while Parent/Child are classes… see the answer below, may clarify your doubts. class Parent(): def __init__(self): self.myvar = 1 class Child(Parent): def __init__(self): Parent.__init__(self) # … Read more

Is it possible for class to inherit the annotations of the super class

Yes it is possible if the annotation has @Inherited added to it. For example, the @Transactional annotation has @Inherited. From the docs: Indicates that an annotation type is automatically inherited. If an Inherited meta-annotation is present on an annotation type declaration, and the user queries the annotation type on a class declaration, and the class … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)