-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
 Post subject: embeddedId
PostPosted: Mon Jan 08, 2007 10:11 am 
Beginner
Beginner

Joined: Wed Oct 25, 2006 9:05 am
Posts: 40
Location: France, Lieusaint
I am studying the embeddedId sample model -in ch7/listing7.1- and a question that comes to me is how to persist it because an id is a
Code:
Long
at final?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 08, 2007 11:12 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
I do not understand your question. I'm surprised; a few weeks ago you had questions about Hello World, now you are trying to work on the most complex and difficult mapping in the whole book? Are you sure you need that?

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: embeddedId
PostPosted: Mon Jan 08, 2007 11:50 am 
Beginner
Beginner

Joined: Wed Oct 25, 2006 9:05 am
Posts: 40
Location: France, Lieusaint
Christian,

Yes, I'm very 'eager' ;-) ...

If I need it ?

Yes, I have a complex type made of two keys-a link key- and I need synchonize on another base. So I compare update a java table with the ID of record in this complex type to then compare to loaded type.

Anyway, I need to wrote the DAO for this type, and this is what makes me wonder....


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 08, 2007 11:52 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
I still do not understand you.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: embeddedId
PostPosted: Mon Jan 08, 2007 11:56 am 
Beginner
Beginner

Joined: Wed Oct 25, 2006 9:05 am
Posts: 40
Location: France, Lieusaint
ok,
my question is:

In listing 7.1/p304 the id is of type Id. My DAO is waiting for Long type, so how do I manage this complex type?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 08, 2007 1:55 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Change your DAO. Read chapter 16.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: embeddedId
PostPosted: Tue Jan 09, 2007 5:16 am 
Beginner
Beginner

Joined: Wed Oct 25, 2006 9:05 am
Posts: 40
Location: France, Lieusaint
Christian,

I have extended a type DAO, TypeDAO with type interface <T, ID extends Serializable> and that's ok.

But when I want to implement a TypeDAOHibernate which implements TypeDAO compiler returns following message:

-------------
The interface DAO cannot be implemented more than once with different arguments: DAO and DAO<TypeQuantite,LnkTypeQteTitle.LinkId> dao/type/hibernate LnkTypeQteDAOHibernate.java line 10
_________

I dont understand this message, can you light me ?

thx


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 09, 2007 5:17 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Why don't you download the source code for the book?

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: embeddedId
PostPosted: Tue Jan 09, 2007 8:10 am 
Beginner
Beginner

Joined: Wed Oct 25, 2006 9:05 am
Posts: 40
Location: France, Lieusaint
Christian,

I've found in this chapter all what I needed.

thx


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.