-->
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: Possible problem with hbm2java and ID type
PostPosted: Thu May 12, 2005 7:48 am 
Regular
Regular

Joined: Mon Apr 25, 2005 9:22 am
Posts: 62
Location: Bucharest/Romania
Hibernate version: 3.0.3

Mapping documents:
<hibernate-mapping package="com.ez.ezrt.model">
<class name="ITDatabaseNL"
table="ITDATABASE"
mutable="false"
batch-size="10">
<id name="id"
type="java.lang.Long"
column="ID"
unsaved-value="0">
<meta attribute="field-scope">protected</meta>

<generator class="identity" />
</id>
[...]


Generated code:
Code:
public class ITDatabaseNL  implements java.io.Serializable {
    // Fields   
     private long id;

    // Property accessors

    /**
     *
     */
    public long getId() {
        return this.id;
    }
   
    public void setId(long id) {
        this.id = id;
    }


As you can see the mapping declared ID as a java.lang.Long, but in generated java it is long.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 8:34 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes we are going to change it. currently it generates long because the property cannot be null....but that was wrong to do so ;)

/max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 9:27 am 
Regular
Regular

Joined: Mon Apr 25, 2005 9:22 am
Posts: 62
Location: Bucharest/Romania
Is a JIRA issue attached to this?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 11:46 am 
Regular
Regular

Joined: Mon Apr 25, 2005 9:22 am
Posts: 62
Location: Bucharest/Romania
I hope i will have time to look into the HBX-259.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 4:18 pm 
Beginner
Beginner

Joined: Thu Jan 29, 2004 6:51 pm
Posts: 24
Location: Boulder, CO USA
Is there a timeframe for getting this fix into CVS? It is a showstopper for our move from 2.1 to 3. We have a large codebase dependant on wrapper classes, not primitives.

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 4:20 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
im changing it tonight hopefully.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 4:20 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
and note you can override it with <meta attribute="property-type">xx</meta> anyhow.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 4:58 pm 
Beginner
Beginner

Joined: Thu Jan 29, 2004 6:51 pm
Posts: 24
Location: Boulder, CO USA
Ah. Thanks. That's a nice stop gap until it's fixed.


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.