Changing @ Inheritance(strategy = InheritanceType.SINGLE_TABLE) to InheritanceType.JOINT or InheritanceType.TABLE_PER_CLASS wont work with @GeneratedValue(strategy = GenerationType.IDENTITY.
For @ Inheritance(strategy = InheritanceType.JOINT) changing to GenerationType.AUTO worked.
For @ Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) changing to
Patrick, thanks a lot for these videos! They are most definitely very useful. However, i think that you should never recommend using JOIN statements when dealing with databases as it is by far the most expensive operation to perform in any database system. Speed is nowadays usually more important than space and thus, for general purpose, I think that the best strategy to recommend is the TABLE_PER_CLASS.
Exception in thread "main" org.hibernate.MappingException: Can not use identity column key generation with mapping for hibernatechapter5Inheritancemapping.Module
Hi Patrick -- thanks once again for providing excellent training materials.
The first two strategies worked for me. I then dropped all tables, but 3rd strategy still fails with org.hibernate.Mapping-Exception: Cannot use identity column key generation with union-subclass mapping for: com.hibernate.chapter1.Project.
Do you know why I'm getting this error? Using Hibernate 3.4 and MySql 5.1
@patrickwashingtondc changing the generationtype strategy on ID worked for me too.. i had the mapping exception and this little modification worked wonder.. can you explain what is the difference between default strategy and Table
Hi, I had the same error ("Cannot use identity column key generation with union-subclass mapping for: com.hibernate.inheritance.Task"). Tables were recreated but there was a problem with inserting data.
I've changed GeneratedValue strategy to @GeneratedValue(strategy=GenerationType.TABLE) and now it works fine.
@HaveABeautifulLife : Remove @ID attribute, and assign primary key manually in Client program. Initially i have got same error, and i have rectified it by removing @Id attribute. Praveen
it's very helpful for me
007vargheseg 1 month ago
Nice tutorial
007vargheseg 1 month ago
Very Good Patrick like it ) its so simple when you expain . Great Job!
greatnilesh 7 months ago
Changing @ Inheritance(strategy = InheritanceType.SINGLE_TABLE) to InheritanceType.JOINT or InheritanceType.TABLE_PER_CLASS wont work with @GeneratedValue(strategy = GenerationType.IDENTITY.
For @ Inheritance(strategy = InheritanceType.JOINT) changing to GenerationType.AUTO worked.
For @ Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) changing to
GenerationType.TABLE worked.
Thanks again for the great tutorial.
sv2021 7 months ago
@sv2021 : Wow.. great... i have followed you and works great.. Thanks dude....
richardsforyou 5 days ago
Hi Patrick, your vedios have realy helped me a lot in learning hibernate. Thankyou very much. Greate work. All our good
wishes are with you. Thanks a lot.
meghakharde 8 months ago
Patrick, thanks a lot for these videos! They are most definitely very useful. However, i think that you should never recommend using JOIN statements when dealing with databases as it is by far the most expensive operation to perform in any database system. Speed is nowadays usually more important than space and thus, for general purpose, I think that the best strategy to recommend is the TABLE_PER_CLASS.
phewdotse 11 months ago
Hi, I have a problem when I put @ Inheritance
(strategy = InheritanceType.TABLE_PER_CLASS)
I get the following error:
Exception in thread "main" org.hibernate.MappingException: Can not use identity column key generation with mapping for hibernatechapter5Inheritancemapping.Module
yovisioso 11 months ago
Hi Patrick,
Thanks a lot for the videos . very kind of you.
Nice baritone voice
GOD bless you with PROFOUND HAPPINESS and SUCCESS in all you do.
Please do the same for STRUTS and SPRING.
japan2009isbest 1 year ago
Hi Patrick! Thank you so much for the tutorials you have posted. They are priceless.
oibabu 1 year ago
question !!!
- how can you inherit a class prop that is not the next up.
-i want to use the prop form a class that is 3 clases up , without ussing some prop for the imidiate upper clases ???
MrOprea3 1 year ago
@MrOprea3 you can simply annotate the properties you don't want as transient. Check my previous videos.
patrickwashingtondc 1 year ago
can any one share spring videos like this
venu0105 1 year ago
This has been flagged as spam show
can any one share spring videos like these
thanks
venu
venu0105 1 year ago
Hi Patrick -- thanks once again for providing excellent training materials.
The first two strategies worked for me. I then dropped all tables, but 3rd strategy still fails with org.hibernate.Mapping-Exception: Cannot use identity column key generation with union-subclass mapping for: com.hibernate.chapter1.Project.
Do you know why I'm getting this error? Using Hibernate 3.4 and MySql 5.1
HaveABeautifulLife 1 year ago
@HaveABeautifulLife It doesn't matter what database you use. Physically deleting the tables should be enough to recreate them.
patrickwashingtondc 1 year ago
@patrickwashingtondc changing the generationtype strategy on ID worked for me too.. i had the mapping exception and this little modification worked wonder.. can you explain what is the difference between default strategy and Table
chintureddyk 1 year ago
@chintureddyk its explained in the videos
patrickwashingtondc 1 year ago
Hi, I had the same error ("Cannot use identity column key generation with union-subclass mapping for: com.hibernate.inheritance.Task"). Tables were recreated but there was a problem with inserting data.
I've changed GeneratedValue strategy to @GeneratedValue(strategy=GenerationType.TABLE) and now it works fine.
mongrom 1 year ago
@HaveABeautifulLife : Remove @ID attribute, and assign primary key manually in Client program. Initially i have got same error, and i have rectified it by removing @Id attribute. Praveen
richardsforyou 5 days ago