-->
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: Use GenerationType.SEQUENCE from JPA for BigInteger
PostPosted: Tue Oct 13, 2009 2:53 am 
Newbie

Joined: Tue Oct 13, 2009 2:27 am
Posts: 1
[sorry for my english]
I use JPA/Hibernate (standart version in JBoss 5.1.0) on old database (Oracle 10g).
In this database used ID type NUMBER(38) (and exists ID more 10^20).

Id Entity I need use BigInteger.

1. Why used org.hibernate.id.SequenceHiLoGenerator for @GeneratedValue(strategy = GenerationType.SEQUENCE) ? SequenceGenerator work correct.

2. Why SequenceHiLoGenerator can not work with BigInteger?

3. is this going to be fixed?

PS: TopLink correct work with BigInteger.
PPS: where I can see version of Hibernate in jboss?


Top
 Profile  
 
 Post subject: Re: Use GenerationType.SEQUENCE from JPA for BigInteger
PostPosted: Fri Feb 25, 2011 5:34 am 
Newbie

Joined: Fri Sep 29, 2006 5:20 am
Posts: 8
Hi all, I have the same problem:

@SequenceGenerator(name = "seq", sequenceName = "sequence")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq")
@Column(name = "XXX", nullable = false, length = 20)
BigInteger ix;
...}

Does not work (ix is always null). Changing BigInteger to Long works.

Any advice?

I am using Hibernate 3.6.1.Final


Top
 Profile  
 
 Post subject: Re: Use GenerationType.SEQUENCE from JPA for BigInteger
PostPosted: Fri Feb 25, 2011 8:35 am 
Newbie

Joined: Fri Sep 29, 2006 5:20 am
Posts: 8
works fine with

BigInteger ix = new BigInteger("0");


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.