sequence 4 « Map « JPA Q&A





1. oracle sequences    forum.hibernate.org

Here's the situation: I have a non-hibernate part of my application that does an insertion in to the RFQ_DATA table using straight SQL: insert into rfq_data (filename, rfq_data_id, parent_po_id, date_generated, extension, status, type, username) values (?, rfq_data_id_seq.nextval, ?, sysdate, ?, 'PENDING', ?, ?) As you can see, it sets the key field (rfq_data_id) to rfq_data_id_seq.nextval I then have a hibernate part ...

2. Problem with use of sequence for attribute    forum.hibernate.org

Hi All , In my current application I ma using sequence option for the id generator. And while I am trying to do the batch insert it is not working properly . While I am calling session.save() it is trying to do a nextVal call from database to get the unique id value to make that object persistent , but those ...

3. indexed collection with id sequence    forum.hibernate.org

(...sorry for my english...) I have a table PARENT P with P.ID P.DESCRIPTION and I must map an indexed collection with a list in a table CHILD C. C.ID C.INDEX C.VALUE what is the best mapping solution for save/update the parent and the child so that the P.ID is assigned by a oracle sequence and C.ID is assigned by P.ID (the ...

4. PostgreSql sequence does not see to work for me    forum.hibernate.org

PostgreSql sequence does not see to work for me. If I change it to increment it works fine. According to the manual (Basic O/R Mapping chapter 3) I should use sequence. Does anyone have any insight on this? Here is my mapping file. And of course my code section. If that is any help. Thanks ray lukas MY MAPPING FILE ------------------------ ...

6. Query Oracle Sequence    forum.hibernate.org

Hi, I'm new in hibernate and java. I need to retrieve a sequence value from the database. This sequence is intended to be used as part of a column value. Not as an ID. I cant figure out how can I have an hibernate ojbect which represents this sequence and how can I query that object directly to obtain the next ...

7. Oracle Sequence Value Skipped - DB Insert problem    forum.hibernate.org

Problem Explanation: I am setting up a table to do insert using Oracle Sequence.The index field ( field) is getting different values than what is retreived by sequence.nextval DB call. I am using Oracle 10g, Hibernate (3.0.5). The column is question is the primary key, a NUMBER(10). The underlying property is a Long, set to null (as it is a new ...

8. Oracle 8.1.6 identity sequence problem    forum.hibernate.org

Newbie Joined: Sat Jun 25, 2005 7:38 am Posts: 5 I have read the same problem in this thread but no answer was posted: http://forum.hibernate.org/viewtopic.php?t=943111 Hibernate version: 3.0.5 Mapping documents: Code: ...

9. sequence oracle    forum.hibernate.org

hello, I want Id column of table increase 1, on every insertion. I tried to use . my_seq but it did not work. --Do I have to use trigger for this? --Are there any built in generetor in hibernate to increase the id colunm without using oracle sequence or trigger?





10. Oracle sequence generator problem    forum.hibernate.org

After reading documentation and all, I understood that the method to use the Oracle sequence generator for generation of id's is: PFX_APP_MC_CORRESPONDENCE_SEQ I am using oracle 9i and the sequence PFX_APP_MC_CORRESPONDENCE_SEQ exists. Even so, hibernate fails to find the correct sequence name, and gives the following error: ... Hibernate: select hibernate_sequence.nextval ...

12. Is it possible to reset the sequence numbers    forum.hibernate.org

15. oracle sequence error!    forum.hibernate.org

ID_SEQ ...





17. PostgreSQL "native" uses sequence instead of seria    forum.hibernate.org

Anyone knows why the PostgreSQLDialect uses sequences instead of PostgreSQL "serial" or "bigserial" data type for the native id mapping ? PostgreSQL 8 supports identity generation via serial and bigserial data types, and there is no reason to use sequences when mapping id as "native". The documentation states that native picks identity, sequence or hilo depending on the capability of the ...

18. hibernate_sequence at PostgreSQL    forum.hibernate.org

Hello, I've been changing the Hibernate 3.0 to 3.1rc1 + annotations 3.1beta5, and I got rid of those XML files. Now I'm trying annotations, but suddenly I got the following error when saving: ERROR 04:02:52 org.hibernate.util.JDBCExceptionReporter.logExceptions(L72) - ERROR: relation "hibernate_sequence" does not exist The Object I'm trying to save is simple: ... @Id(generate = GeneratorType.AUTO) public Long getId() { return this.id; ...

19. Where to define the sequence to be used on generator class?    forum.hibernate.org

But if the sequence has to be created on the db, which i thought it had to, how does hibernate know the sequence to be used if i don't have the tag? This is what i have: I couldn't find a way to place the sequence name yet... Thanks a lot ...

20. Oracle sequence unique ids out of order!    forum.hibernate.org

As far as I know, Oracle fetches internally a set of sequence number per jdbc-connection (oracle session) and asigns for example id-numbers out of these sets (if all sequence numbers are assinged, another set will be fetched and so on.). So ids might have 'jumps' in their evolution with two or more database-sessions using a 'shared' sequence. I'm not sure, if ...

21. Oracle sequence Nextval    forum.hibernate.org

22. Dialect does not support sequences ????    forum.hibernate.org

Hi, I'm trying to use a sequence generator with Oracle 9i and Hibernate 2.1.8, but I get a "net.sf.hibernate.MappingException: Dialect does not support sequences" error when Hb reads my config file. Doesn't support sequences??? The docs specifically state that sequences are supported for Oracle, among others. What am I doing wrong? Here are the particulars: hb config ------------------- ...

23. Is it possible to create more than one sequence for a class?    forum.hibernate.org

/** * The method has been copied here to be able to add specific xdoclet * tag for this class. * @hibernate.id type="java.lang.Integer" column="MyId" generator-class="native" * @hibernate.generator-param name="sequence" value="SEQ_POIL1" */ public Integer getId() { ...

24. HSQL for testing can't generate sequence?    forum.hibernate.org

[junit] org.hibernate.exception.GenericJDBCException: could not get next sequence value [junit] at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92) [junit] at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80) [junit] at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) [junit] at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:96) [junit] at ...

25. How to fetch Sequence.next val from Hibernate    forum.hibernate.org

HI I need help in following scenario . i have a table by name Retailer_Registry . it has following field mappings guid, Last_updated_user, Addressline1 AddressLine2... .... ... .. Retailer_Registry_UID etc . Here apart from guid Retailer_Registry table column is unique . The value of this column in populated for each transaction from a different table called say UID pool . so ...

26. how do you generate non-sequence unique ids in hiberanate    forum.hibernate.org

You can write your own generator. How about one that just returns the hashCode() of your business key? E.g. if all the objects in your table have a unique serial number, just return the hashCode of the serial number of the object from the generator. It will be sensible, useful, (probably) unique, and non-sequential.

28. Does Postgres Dialect support sequences    forum.hibernate.org

The following exception is thrown when I try to build a session factory. I was under the impression that the "org.hibernate.dialect.PostgreSQLDialect" dialect supports sequences. Am I wrong or is there something wrong with my config. CORDER_SEQ Any help would be appreciated. Thanks Lee net.sf.hibernate.MappingException: could not instantiate id generator at net.sf.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:82) at net.sf.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:82) ...

29. execute db2 sequence    forum.hibernate.org

I didn't quite understand what you ment by "in hibernate api to set property" but there's nothing to stop you from accessing the JDBC connection and just executing a SQL statement to retreive the nextval. Since your not strictly speaking querying for a object this seems the most straight forward course of action.

30. Empty collections using PK with sequence    forum.hibernate.org

Hi, I've a database table whose primary key is composed by a varchar column and an oracle sequence (yes, that's right). Also, this table has many-to-one relationships. The hibernate mapping file is (hidding irrelevant information): CAPACEX.CAEXNEXPED ...

32. globally change hibernate_sequence    forum.hibernate.org

33. Exception like could not generate the next sequence value    forum.hibernate.org

Dear Technical staff, In my application , I am using MDB and Hibernate 3.1 . In the onMessage() method of Message Driven Bean, I am calling one method from a class which is responsible for storing the three objects in the Oracle database using Hibernate. This application was running perfectly about a few days ago. When the database user was dropped ...

34. Can't use other users sequences in oracle9i    forum.hibernate.org

35. How to get the sequence number without saving the dto    forum.hibernate.org

Hi all, I need to get the sequence number to use in my application, before inserting it into the database. is generating the sequence number only after i do session.save(somedto). Unfortunatly i have some not null values, hence i cannot just save an empty dto. Hence i have to get the sequence first before saving. Please help in what is ...

36. Mapping sequences in joined-subclasses    forum.hibernate.org

Hi everyone, I am trying to map a sequence, a surrogate key, to my sub-class. I have tried the attribute 'generated' but but is did not work. SQ_OBJETO_IMOBILIARIO