-->
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.  [ 3 posts ] 
Author Message
 Post subject: hbm2java ignores mutable=false set by Middlegen
PostPosted: Mon Nov 14, 2005 8:27 am 
Newbie

Joined: Tue Oct 18, 2005 8:43 am
Posts: 15
hello,
I am running Oracle 8.1.7, Hibernate 3.0 and Middlegen from CVS with version="3.0" attribute in the hibernate sub-task in ant.

In the Middlegen GUI, I uncheck the mutable checkbox. Middlegen produces the following mapping:
Code:
<class
    name="com.acme.ge.generated.ComponentPowerLimit"
    table="COMPONENT_POWER_LIMITS"
    mutable="false"
    lazy="false"
>


But even though mutable is set to false, hbm2java generates setters for my POJOs.
I found a workaround in another thread (http://forum.hibernate.org/viewtopic.php?t=948288), which says that <meta attribute="scope-set">private</meta> should do the thing. This is ok, but I wonder why Middlegen is producing mutable=false, when it doesn't really have an impact!? Is there any way to use Middlegen and still end up with unmutable POJOs in the end?

cheers,
pj


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 14, 2005 8:53 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The mutable attribute affects hibernates' behaviour not the code generators. As you discovered, the scope meta data [as all the meta data attributes] affects the generators behaviour.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 14, 2005 8:54 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it has an effect on how hibernate treats the objects.

we could probably change the default scope for a non mutable property to private (protected?) for its setters.

add a jira for it

_________________
Max
Don't forget to rate


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