-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate @Generated annotation and the following select
PostPosted: Mon Apr 08, 2013 11:00 pm 
Newbie

Joined: Mon Apr 08, 2013 10:48 pm
Posts: 1
Hibernate 4.0.1
DB: MySql

I'm using @Generated(GenerationTime.XXX) annotation for createdOn and modifiedOn columns.
After saving or updating the entity hibernate immediately executes SELECT statements to get these generated values from DB.

Is there any way to avoid this SELECT? or it would be even better to have it lazily executable.

Most of the time execution logic as follows (for example, creation of an Account):
1. Create Object entity
2. Fill the properties
3. Persist it to DB.

That's it. But in the logs i always see this SELECT statement at the end. Which is useless by this time. And may affect the performance.

Thank you.


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.