-->
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.  [ 5 posts ] 
Author Message
 Post subject: id without property
PostPosted: Sat Jun 11, 2005 4:50 am 
Newbie

Joined: Sat Jun 11, 2005 4:16 am
Posts: 2
Hi,

in
http://www.hibernate.org/hib_docs/v3/re ... aration-id
I read that most classes will also have a JavaBeans-style property holding the unique identifier of an instance.

As described it is perfectly fine to ommit the name attribute in the <id> tag.

What is the equivalent of that in the annotations world?
How do I annotate classes that don't carry a property holding the unique identifier?

mf


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 11, 2005 5:30 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Read the EJB spec draft, entity beans need an identifier property.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 6:32 am 
Newbie

Joined: Sat Jun 11, 2005 4:16 am
Posts: 2
Hi,

christian wrote:
Read the EJB spec draft, entity beans need an identifier property.


maybe I don't understand the scope of Hibernate Annotations, but wouldn't that be a reson for something like:

Code:
package org.hibernate.annotations;
[...]
@Target(TYPE) @Retention(RUNTIME)
public @interface Id {
   String column();
   GeneratorType generate() default NONE;
   String generator() default "";
   [...]
}



mf


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 6:34 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
No


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 16, 2005 8:54 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
The thing is that your request is quite uncommon and has some important drawbacks (unability to play with detached objects etc etc).

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.