-->
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.  [ 8 posts ] 
Author Message
 Post subject: Order of state arrays in Interceptor methods
PostPosted: Wed Aug 18, 2004 3:23 pm 
Beginner
Beginner

Joined: Mon Aug 09, 2004 3:35 pm
Posts: 22
Location: Minneapolis, MN, USA
Looking through the 2.1.6 code, it appears that you can rely on
the values for the state parameters in the Interceptor methods
to always appear in the same order for a given entity. Is this just a
byproduct of the current code or is this intended?

thanks,

-r


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 18, 2004 3:36 pm 
Beginner
Beginner

Joined: Mon Aug 09, 2004 12:31 pm
Posts: 47
Location: New York, NY, USA
What's the difference? You should be examining each entity in the array and acting on its state (or not) as desired.

_________________
--DP


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 18, 2004 3:44 pm 
Beginner
Beginner

Joined: Mon Aug 09, 2004 3:35 pm
Posts: 22
Location: Minneapolis, MN, USA
dplass wrote:
What's the difference? You should be examining each entity in the array and acting on its state (or not) as desired.


For the current problem, I don't care what the state is. However,
I do care that any time the same entity is loaded from the DB, the
state array will look the same for each load. I want to generate a
checksum of the current state, so the order is important.

-r


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 19, 2004 3:40 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
This is intended. It is the same order as the mapping doc.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 19, 2004 9:27 am 
Beginner
Beginner

Joined: Mon Aug 09, 2004 12:31 pm
Posts: 47
Location: New York, NY, USA
You could just alphabetize the properties (and keep track of their associated state), which will keep the order the same.

_________________
--DP


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 19, 2004 12:01 pm 
Beginner
Beginner

Joined: Mon Aug 09, 2004 3:35 pm
Posts: 22
Location: Minneapolis, MN, USA
dplass wrote:
You could just alphabetize the properties (and keep track of their associated state), which will keep the order the same.


Yeah, ordering them would be easy, but I'm lazy. So, if I don't need
to order them myself, all the better.

-r


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 19, 2004 12:24 pm 
Beginner
Beginner

Joined: Mon Aug 09, 2004 12:31 pm
Posts: 47
Location: New York, NY, USA
But, if at any time in the future, the order *does* change, you'll be wondering why your checksums don't work...

By the way, automatically computing a checksum on every row is a neat idea.

_________________
--DP


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 19, 2004 12:45 pm 
Beginner
Beginner

Joined: Mon Aug 09, 2004 3:35 pm
Posts: 22
Location: Minneapolis, MN, USA
dplass wrote:
But, if at any time in the future, the order *does* change, you'll be wondering why your checksums don't work...


Yeah, but I'm not real concerned given Gavin's response, the Hibernate
code is pretty dependent on that ordering. I'm only making a short-term
fix anyway.

dplass wrote:
By the way, automatically computing a checksum on every row is a neat idea.


But it's problematic--throw collections in the mix and you get yourself
a tedious task.

-r


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 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.