-->
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: Proxy intialized when accessing a @Transient property?
PostPosted: Wed Apr 01, 2009 3:32 pm 
Beginner
Beginner

Joined: Wed Jan 25, 2006 10:18 am
Posts: 28
I've got an entity with only two properties:
Code:
class Entity:
  @Id
  Long id;

  @Transient
  String transientProperty;


The transient property is populated from an Interceptor#instantiate method:
Code:
Interceptor#instantiate:
  entity.setTransientProperty(...);
  return entity;


So I would expect this code not to hit the db:
Code:
main:
  entity = session.load(id);
  entity.getId(); // Does not hit the db
  entity.getTransientProperty();  // Hits the db, then calls Interceptor#instantiate


Is there any way to prevent this code from executing any SQL? It shouldn't be necessary as the only non-transient property is the actual PK.

Thanks,
ms


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