-->
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: Automatische ID vergabe mittels sequence Problem
PostPosted: Sun Nov 29, 2009 6:10 am 
Newbie

Joined: Tue Nov 24, 2009 12:58 pm
Posts: 1
Hallo!

Ich habe folgendes Problem:

Ich habe eine Tabelle Abteilung mit PK abt_id.
Diesen PK - abt_id - will ich automatisch vergeben lassen. Habe mich für sequence entschieden, da ich denke dass diese Lösung die performanteste ist. oder?
Arbeite auf einer Postgres-DB.

Hier mein Mapping-File:
Code:
    <id name="abtId" type="int">
      <column name="abt_id"/>
      <generator class="sequence">
          <param name="abteilung_abt_id_seq"/>
      </generator>
    </id>


Wenn ich jetzt aber versuche zu speichern wirft er folgende Exception:

Quote:
Hibernate: select nextval ('hibernate_sequence')
------------------------------------
29.11.2009 09:23:06 org.hibernate.util.JDBCExceptionReporter logExceptions
WARNUNG: SQL Error: 0, SQLState: 42P01
29.11.2009 09:23:06 org.hibernate.util.JDBCExceptionReporter logExceptions
SCHWERWIEGEND: FEHLER: Relation »hibernate_sequence« existiert nicht
29.11.2009 09:23:06 com.sun.faces.application.ActionListenerImpl processAction
SCHWERWIEGEND: java.lang.NullPointerException
javax.faces.el.EvaluationException: java.lang.NullPointerException
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
at javax.faces.component.UICommand.broadcast(UICommand.java:383)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:18)


Bitte um Hilfe!


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.