-->
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: Generated non-id value by sequence
PostPosted: Thu Nov 20, 2008 1:29 pm 
Newbie

Joined: Thu Nov 13, 2008 8:21 am
Posts: 8
I found via "search" many other guys with the same problem but always without any reasonable approach.

I try to get a JPA property value generated by a sequence, which is defined on a oracle10g db.

I have a property:

Code:
   @Column(name = "LEISTUNG_NR_QUELLSYSTEM", insertable = false, updatable = true, nullable = false, precision = 12, scale = 0)
   @SequenceGenerator(name="LST_NR_QU_SYS_GEN", sequenceName="CIS_LSLDPLLST_LSTNRQUSYS_SEQ")
   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="LST_NR_QU_SYS_GEN")
   public long getLeistungNrQuellsystem() {
      return this.leistungNrQuellsystem;
   }


and the appropriate sequence on the db:

Code:
CREATED   12.11.08
LAST_DDL_TIME   12.11.08
SEQUENCE_OWNER   CRDE_ERFASSUNG
SEQUENCE_NAME   CIS_LS_LEIST_LEISTNR_SEQ
MIN_VALUE   1
MAX_VALUE   999999999999999999999999999
INCREMENT_BY   1
CYCLE_FLAG   N
ORDER_FLAG   N
CACHE_SIZE   0
LAST_NUMBER   1


but it is unfortunately not working. The property left "null".

I know that it is basically possible with Hibernate but in case of JPA I'm not sure.

Is there a serious solution or is it simply impossible?

I'm a using Eclipse 3.3.2, ejb3-persistence.jar, Oracle10g, ojdbc14.jar, JDK 1.5.0_14

Mario


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.