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: Urgent quick question - One way "transiency"?? Howto..
PostPosted: Wed Apr 07, 2010 9:22 am 
Newbie

Joined: Thu Mar 25, 2010 7:55 am
Posts: 8
Hi all!

Does any one know how to best make fields "one-way" transient. I have a DB where some fields are filled by the Database itself when an insert happens. Ie when I persist the related hibernate object I get an exception, that I cant write to those fields. But if I make the field @Transient, its not loaded from the Database.

Dont quite get it, do I need to actually create an sql (hibernate) query just to store the object minus the fields that should not be posted??

Thanks a lot,
Cheers,
CC


Top
 Profile  
 
 Post subject: Re: Urgent quick question - One way "transiency"?? Howto..
PostPosted: Thu Apr 08, 2010 6:45 am 
Newbie

Joined: Thu Mar 25, 2010 7:55 am
Posts: 8
*bump*

Is that really not possible in Hibernate? Or just a hard question?


Top
 Profile  
 
 Post subject: Re: Urgent quick question - One way "transiency"?? Howto..
PostPosted: Thu Apr 08, 2010 11:25 am 
Newbie

Joined: Thu Mar 25, 2010 7:55 am
Posts: 8
sorry due to the urgency I need to keep on bumping it!

Is the approach to create my own "hsql" or is there an annotation that could help me?

I just need a hint!

Thanks very much!


Top
 Profile  
 
 Post subject: Re: Urgent quick question - One way "transiency"?? Howto..
PostPosted: Thu Apr 08, 2010 11:27 am 
Regular
Regular

Joined: Thu Dec 10, 2009 10:53 am
Posts: 50
did you try annotating it with @Column(insertable=false,updateable=false)?


Top
 Profile  
 
 Post subject: Re: Urgent quick question - One way "transiency"?? Howto..
PostPosted: Fri Apr 09, 2010 6:12 am 
Newbie

Joined: Thu Mar 25, 2010 7:55 am
Posts: 8
Gees Louise kossomo, I spent all the time searching in the hibernate annotations rather the jpa ones!

Thanks a lot mate, I havent tried it, but thats going to be it!

Cheers!!
CC


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.