-->
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: changing default property behavior
PostPosted: Mon Oct 17, 2005 4:40 pm 
Newbie

Joined: Tue Sep 09, 2003 3:39 am
Posts: 14
Location: Atlanta, GA
Section 2.2.2 of the hibernate annotations doc says:

Quote:
By default, every non static property of an entity bean is considered persistent, unless you annotate it as @Transient.


How do I reverse this behavior?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 18, 2005 3:03 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You cannot

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 3:04 pm 
Newbie

Joined: Tue Sep 09, 2003 3:39 am
Posts: 14
Location: Atlanta, GA
Is this planned for a future release? I hope so, because when adding hibernate to a legacy class (especially a fat, bloated legacy class), I'd rather mark the few fields I want to persist, instead of marking the rest of cruft as @Transient.

Anyway, I would suggest removing the "By default" from the docs, since it suggests that this option is configurable.

Cheers!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 24, 2005 6:12 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I fixed the doc, I'm not keen on making this feature configurable though, unless it's wildely requested.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 25, 2005 3:32 pm 
Newbie

Joined: Tue Sep 09, 2003 3:39 am
Posts: 14
Location: Atlanta, GA
Hehe, then consider this a +1 vote.

I think it makes sense as a feature, given hibernate's ability to work with any development style (model-centric, schema-centric, mapping-centric).

In my case, where I have a legacy model and schema, it is easier to annotate just the pieces of the model that I want to persist.

If I were working in greenland development, I would be generating everything off of my fresh new model, and would prefer the current approach: annotate what I don't want to persist (which probably wouldn't be that much).

Right now the latter approach requires only a few annotations. Making this an option would enable the former approach to also require only a few annotations.

Cheers!


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.