Results 1 to 1 of 1
Thread: Override Entity Callback Method
- 12-13-2009, 07:05 AM #1
Member
- Join Date
- Oct 2009
- Posts
- 16
- Rep Power
- 0
Override Entity Callback Method
"A class is permitted to override an inherited callback method of the same callback type, and in this case, the overridden method is NOT invoked."
However in the example given, the overriden method is invoked...
@Entity
public class Animal {
....
@PostPersist
protected void postPersistAnimal() {
System.out.println("Inside Animal.postPersistAnimal()");
}
}
@Entity
@EntityListeners({CatListener.class, CatListener2.class})
public class Cat extends Pet {
...
}
@EntityListeners(SiameseCatListener.class)
@Entity
public class SiameseCat extends Cat {
...
@PostPersist
protected void postPersistAnimal() {
System.out.println("Inside SiameseCat.postPersistAnimal()");
}
}
Here the overridden method SiameseCat.postPersistAnimal() is called and Animal.postPersistAnimal() is not at all called.
Similar Threads
-
method not abstract, does not override actionperformed method.
By Theman in forum New To JavaReplies: 2Last Post: 03-26-2010, 06:12 PM -
...is not abstract and does not override abstract method...
By Addez in forum New To JavaReplies: 3Last Post: 09-16-2009, 10:27 PM -
How to override Equals method with a Java File
By JordashTalon in forum New To JavaReplies: 6Last Post: 01-22-2009, 04:25 AM -
GameImpl is not abstract and does not override abstract method
By Macca07 in forum New To JavaReplies: 2Last Post: 11-21-2008, 01:20 AM -
Error! "filename" is not abstract and does not override abstract method...
By hasani6leap in forum New To JavaReplies: 6Last Post: 10-27-2008, 01:25 AM
Bookmarks