1 Reply Latest reply on Jan 25, 2004 11:14 PM by Chris Malan

    EJBQL Question

    b_boyle18 Newbie


      I am using PostgreSQL with Jboss 3.0.8. I want to setup automatic primary key generation so I don't have to add the primary key myself each time. What I have done is created a sequence in Postgres that generates a new priamry by getting me the next value in the sequence. I found out how to do this here: http://www.pirack.com/viewHowto.xphp?id=3
      This works in postgres, but in my ejb what I am trying to do is to have a finder method that will find execute this seuence and return the next primary key for me. I will then put this in as the primary key argument in my ejbcreate() method. However, jboss does not recognise my sql statement : @ejb.finder
      query="SELECT nextval ('voter_id_SEQ')"
      signature="java.lang.Integer findPK()"
      It does not recognise the nextval part. THis works fine in normal SQL. Does anyone know of a way to get around this?
      If you need any additional info i.e erro mesages etc. just ask.
      Thanks in advance,