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.  [ 1 post ] 
Author Message
 Post subject: Id mapped to a sequence returning me Integer
PostPosted: Mon Aug 11, 2008 11:26 am 
Newbie

Joined: Mon Aug 11, 2008 11:04 am
Posts: 1
Location: Hyderabad
Hi All,
Iam getting the following Exception:

Caused by: org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class java.lang.Long, got class java.lang.Integer

My java class is as below :

public class PartyAddress implements Serializable {

/** attribute to store the relation between party and address. */
private Long partyAddressId;
.........
..........

}

My Mapping of the ID is as below:

<id name="partyAddressId" column="UNIQUE_PARTY_ADDRESS_ID" access="field" type="long">
<generator class="sequence" >
<param name="sequence">UNIQUE_PARTY_ADDRESS_ID_SEQ</param>
</generator>
</id>


When my code iterates through the set of PartyAddress objects
,I get the above excetion.

In the documentation it is specified that sequence will return integer,short or long values.Iam explicitly specifying the id to be long,but still I get the error.

Please help.
Thanks in advance


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.