Java Hibernate Tutorial Part 13 - Compound Primary Key

preview_player
Показать описание
Easy to follow step by step tutorial on Java Hibernate Framework using JPA annotations.
Compound Primary Key.
Рекомендации по теме
Комментарии
Автор

Hi Patrick,
First let me congratulate for the gr8 job.

I have gone thu all the posts, u made hibernate simple, it helped me a lot.
please keep ever tutorial made.

Thanks



srvasamsetti
Автор

Thanks quick and fast content to learn.

toshitsharma
Автор

HI Patrick, You have done a great job. Thank u for ur videos. its very useful for me.. keep posting .. waiting for more videos

vijsen
Автор

Thanks for presentation. It was very informative. Very good for beginners.

martha
Автор

You are doing the right thing to the world!

symeraht
Автор

Just incredible, such a tutorial for free! Thank U!

konstantinastamopoulou
Автор

@patrickwashingtondc Thanks Patrick, now it is working fine.
You have Really done excellent job by posted these tutorials.
I have completed all videos(till 17), and waiting for more videos.
Expecting soon you will post those videos as well .

vikassmart
Автор

Thanks for the post. Have gone through all your videos. They are great.. Have a question on this video.. You have used @Embeddable, but not @Embedded annotation. Is this optional? I see you have used both in your previous examples

sivanadiminti
Автор

Hi Patrick -- thanks so much for providing these excellent tutorials.

Question: I followed this tutorial (13) exactly -- added the Entity, Id, and Embeddable annotations on appropriate classes. When I run I get a "null id generated for: class error. Am running all examples with MySql 5.1 in case that makes a difference, Hibernate 3.4. I created the Accounts class and added the CompoundKey to each one like you did -- i.e. the code matches. So ? -- thanks

HaveABeautifulLife
Автор

Hi Patrick -- thanks so much for providing these excellent tutorials.

Question: I followed this tutorial (13) exactly -- added the Entity, Id, and Embeddable annotations on appropriate classes. When I run I get a "null id generated for: class error. Am running all examples with MySql 5.1 in case that makes a difference, Hibernate 3.4.

HaveABeautifulLife
Автор

Thanks for these tutorials, very helpful!

I have a question about creating a Compound Key: In your example, you had a userId and an accountId; Is it possible to have the accountId generated by the DB while we supply the userId? How can we go about doing this with Hibernate?

Thanks a ton!

-K

ksk
Автор

Hello Patrick, I did everything EXACTLY as explained but the program executes with a runtime IdentifierGenerationException provoked by the second invocation of the save method() I repeat...THE SECOND INVOCATION OF THE SAVE METHOD...That is save(checking); the stack trace says null id generated for: class Accounts, take NOTE that the first invocation of the save method, save(savings) works without problems...can you please help with some ideas? regards Ikpefua

jackziaz
Автор

How to composite object using session. Is any menthods are there to get object having composite primary key. Hope Reply

ramakrishnamogilipuri
Автор

@patrickwashingtondc Thanks for the response. Can I use @Embedded annotation for getCompoundKey() method, I see CompoundKey is embedded in Accounts class.

sivanadiminti
Автор

HI Patrick,
Thanks so much for provided these helpful hibernate tutorials.
In video 13 I have follow the same way as suggested in tutorials. I am using same exactly same videos software(DB, eclipse and hibernate). While running this code I am getting below error.
Exception in thread "main" Unknown entity:
at
please help me.

vikassmart
Автор

Hi patrick ..i am geeting error:- " ids for this class must be manually assigned before calling save()" I have done everything you showed in the video . Can you please help.

Swapnil

SwapnilGangrade
Автор

Hi, I would appreciate if you can teach about differenct cardinality with examples. Thanks

martha
Автор

@patrickwashingtondc - Patrick, it is added. Still produces this error, however.

HaveABeautifulLife
Автор

@Id may work, but the better approach would be to use the @EmbeddedId annotation.

MrRobRizzle
join shbcf.ru