-->
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: hibernate events
PostPosted: Mon Oct 03, 2005 8:34 am 
Newbie

Joined: Wed Oct 06, 2004 4:15 am
Posts: 16
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

3.x

Hi all,

I want to create an event listener (i.e. a PreInsertEventListener), being able to inspect the state before insertion. As the state[] only contains the values of the properties, I don't know what's the SECURE way to access to the properties (i.e. how to know whether property "a" is at position 2 in the array of values...???) (I don't think accessing in class field order is a SECURE way, because the VM doesn't impose any specific order, as specified in the Class documentation...).


PreInsertEvent
{
Object getEntity()

Serializable getId()

EntityPersister getPersister()

Object[] getState()
}

Thanks a lot in advance,

Kind Regards,

Carlos


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 03, 2005 8:39 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
get it from the persister


Top
 Profile  
 
 Post subject: getPropertyNames()
PostPosted: Mon Oct 03, 2005 8:43 am 
Newbie

Joined: Wed Oct 06, 2004 4:15 am
Posts: 16
Gavin,

I was looking at the persister before, but the "used for XML generation only" discouraged me using this method

String[] getPropertyNames()
Get the names of the class properties - doesn't have to be the names of the actual Java properties (used for XML generation only)

Is this the correct one??

Kind regards,

Carlos


Top
 Profile  
 
 Post subject: getPropertyNames()
PostPosted: Mon Oct 03, 2005 8:43 am 
Newbie

Joined: Wed Oct 06, 2004 4:15 am
Posts: 16
Gavin,

I was looking at the persister before, but the "used for XML generation only" discouraged me using this method

String[] getPropertyNames()
Get the names of the class properties - doesn't have to be the names of the actual Java properties (used for XML generation only)

Is this the correct one??

Kind regards,

Carlos


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 03, 2005 8:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
right.


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.