-->
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: What mean's mutebable type
PostPosted: Fri Jul 29, 2005 9:16 am 
Newbie

Joined: Fri Jul 22, 2005 10:14 am
Posts: 5
Hello

I'm writing an UserType and I'm not sure my type should be mutable or immutable because the Hibernate StringType is an immutable type but changes to a property of this type will be written to the database!?

What exactly means mutable in the context of UserType?

Thank's

atsch


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 29, 2005 11:11 am 
Senior
Senior

Joined: Tue Jun 21, 2005 10:18 am
Posts: 135
Location: South Carolina, USA
I don't know much about the implementation of StringType, but mutable means the same as it does everywhere else -- an immutable UserType is one that can be assumed to never change.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 29, 2005 2:47 pm 
Expert
Expert

Joined: Tue Oct 05, 2004 9:45 am
Posts: 263
@atsch
far away from beeing a hibernate-expert let me try to explain you my view of "mutable" concerning UserTypes.

The StringType is "immutable" because you can't change the value of the string without changing the instance.

A UserType will be "mutable" if you can change the value of your bean without changing the instance ... for example the DateType is mutable, because you can change the date without changing the "date"-instance.

Therefore you will need different implementations of "deepCopy" ...

HiH
curio


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 29, 2005 9:04 pm 
Beginner
Beginner

Joined: Thu Jul 28, 2005 6:40 pm
Posts: 29
Or another way to put it - an immutable property in a class has a getter but no setter.

- dave


Top
 Profile  
 
 Post subject: Many thank's!
PostPosted: Wed Aug 03, 2005 4:04 am 
Newbie

Joined: Fri Jul 22, 2005 10:14 am
Posts: 5
atsch


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.