sequence 5 « Map « JPA Q&A





2. How Do You Get The Value of a DB Sequence.    forum.hibernate.org

All I want to do is get the value of the sequence. I am building an application on top of a legacy DB. One of the tables has a primary key field that is defined as VARCHAR2(30). In the new application the value of this key field does not have any inherent meaning. My plan is to fetch a sequence value ...

3. Compound Key with sequence generator problem    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version:core 3.2.3, annotations 3.3.0, entity manager 3.3.1, JPA 1.0 Mapping documents:using anotation Full stack trace of any exception that occurs: Name and version of the database you are using: Oracle 10g I have the following relationship I want to model. a Client has many Contacts. The Contact has a compound ...

4. HQL to get next value in a sequence.    forum.hibernate.org

I've searched the forums for an answer to this question, and all the posts suggest that you identify the sequence in your HBM files to auto-insert the values prior to database insert. Unfortunately that won't work for what I'm trying to accomplish. Situation: I am maintaining an application which in production uses DB2. I need to write unit tests for the ...

5. AnyHelpWelcome: oracle insert trigger-sequence ID    forum.hibernate.org

11:08:17,281 DEBUG SQLErrorCodeSQLExceptionTranslator:255 - Unable to translate SQLException with errorCode '2289', will now try the fallback translator 11:08:17,281 DEBUG SessionFactoryUtils:785 - Closing Hibernate Session 11:08:17,312 ERROR SeExamplDAOHbnt:100 - attach failed org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: could not get next sequence value; bad SQL grammar [select hibernate_sequence.nextval from dual]; nested exception is java.sql.SQLException: ORA-02289: sequence does not exist java.sql.SQLException: ORA-02289: sequence does not exist ...

6. generating sequence    forum.hibernate.org

Ok.Let me explain my requirement. I have 3 tables namely : Corporation Department SubDepartment. Now when each of these are created, a id is generated for each.That id is a sequence. There are some redundant fileds that i have mapped to a seperate table called GeneralInfo.This table would contain comman information like address,email id, phone for the above tables. How to ...

7. using sequence generator without id    forum.hibernate.org

Hi All I have a table which already has a composite key id. Now i have a column in this table which is not part of the composite key. I want to populate this column via a sequence generator. In this regard I would like to know how to use a sequence generator on a column without making it a primary ...

8. Hibernate - Sequence - Could'nt instantiate id generator    forum.hibernate.org

Hi , I am new to Hibernate . Any Help is highly appreciated. I am using sequence generator & Oracle 9i is the database . I am getting the error dialect does not support sequences. Hibernate version:2.1 Mapping documents: jdbc:oracle:thin:@localhost:1521:SATORA oracle.jdbc.driver.OracleDriver scott tiger org.hibernate.dialect.OracleDialect ...





10. sequence value for a property    forum.hibernate.org

I have got an entity that has a property that have to be generated via a sequence. This property isn't a id, so I can't spicify generator tag. So, Code: ...

11. How to use a sequence in non-primery-property    forum.hibernate.org

I would like use a sequence in order to get a value for a property (no primery-key). For example, CREATE TABLE PRODUCT ( ID INTEGER NOT NULL, SERIAL DEFAULT (nextVal of a sequence) NOT NULL, ... PRIMERY KEY (ID) ); When I create a product and call saveOrUpdate() method I need that serial is initialized with nextVal of a sequence. How ...

12. sequence value problem    forum.hibernate.org

Hi, i am using hibernate 3.2.1 I have an entity wich gets its ID from specific sequence: @SequenceGenerator(name = "My_SEQ", sequenceName = "seq_sam") @Entity public class MyClass { int id; String name; @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "My_SEQ") public int getId() { } public void setId(int id) { this.id = id; } ... } when i persist a new entity, ...

13. Customized sequence or increment    forum.hibernate.org

Hi, I am using hibernate with annotations and I would like to use a sequence for an ID but using only even numbers (2,4,6....). I will also need to do the same on another table using odd numbers. I searched a lot on the hibernate documentation and on the internet but I wasn't able to find any options usable for sequences. ...

14. overriding sequence generator    forum.hibernate.org

How to override sequence generator with explicit value? I use sequence generator person_id_sequence In rare cases I need to set the id value explicitly. If I set the id then during save() hibernate thinks that object is already in db and falls over on trying to update row rather than insert. What's the ...

15. Mapping select nextval from sequence    forum.hibernate.org

our setup is different, you may want to try this instead. We have our auto-increments set up in the hibernate mapping files. When we execute an INSERT, Hibernate automatically figures out the next key and uses it: In the classxxx.hbm.xml file, we have: Code:

16. Hibernate id sequence problem in oracle    forum.hibernate.org

Good day guys, I'm having a problem with the generation of sequence id in hibernate (using oracle 10g db). My problem is the id sequence generation is incremented by two's. My definition of sequence is like this: CREATE SEQUENCE "MEMBER_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE as you can see my increment value ...





17. Hibernate falsely declares no dialect to get next sequence    forum.hibernate.org

I have been using Hibernate for over a year but upon trying to do something slightly different it all goes to hell. After failing to populate a slightly different table I am resorting to insert statements but need the next sequence. That is failing too. String sql = org.hibernate.dialect.Dialect.getDialect().getSequenceNextValString(seqName); gives me 10:55:44,046 ERROR [Log] org.hibernate.HibernateException The dialect was not set. Set ...

18. Sequence generator per subclass    forum.hibernate.org

19. DB2/390: Problem with getting the next value from a sequence    forum.hibernate.org

2007-09-06 10:34:21,628 DEBUG [org.hibernate.SQL] values nextval for RESKGD.KGQP1H01 2007-09-06 10:34:21,644 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: -142, SQLState: 42612 2007-09-06 10:34:21,644 ERROR [org.hibernate.util.JDBCExceptionReporter] [IBM][CLI Driver][DB2] SQL0142N The SQL statement is not supported. SQLSTATE=42612 2007-09-06 10:34:21,644 ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException in method: public abstract java.lang.Object de.volkswagen.cypris.server.modules.managereferencedata.ejb.DOTStore.saveOrUpdateDOT(java.lang.Class,de.volkswagen.cypris.client.core.domain.DOTTableDOT) throws java.rmi.RemoteException: org.hibernate.exception.SQLGrammarException: could not get next sequence value

20. HSQL failing when blanks in sequence name    forum.hibernate.org

seq_FOO_ID ...

21. Sequence generators in Embedded PK    forum.hibernate.org

22. Sequence in postgres    forum.hibernate.org

Hi All. I have a simple Entity whose field id is as follows @Id @GeneratedValue(strategy=GenerationType.AUTO) Long id; This works fine. a sequence previously created by hibernate is used to generate a value for id column in database. if I do this alter table pessoa alter id set default nextval('seqpessoa'); then change the generation strategy to: @Id @GeneratedValue(strategy=GenerationType.IDENTITY) Long id; I get ...

23. generate property value with sequence    forum.hibernate.org

Yes, I could do something like that. However, I've found that apparently it's possible to define custom insert sql for mapped classes, with a tag on the mapping file. I haven't tried it yet, but I'm thinking that maybe replacing the "?" corresponding to the pk with something like 'select next_val from _sequence_' might work. Anyway, thanks for replying crista_drg! ...

24. one-to-many mapping with sequence    forum.hibernate.org

I am facing one issue with one-to-many mapping with sequence. one ----> Transactionheader many ----->Transactionlines During one of my transactions I will need to create new line item and add to Transactionlines. mapping for transactionlines has configuration to take sequence id. When I left the id for new line and assume hibernate would take care of that from sequence I got ...

25. Native Sequence Usage    forum.hibernate.org

I tried this but I really couldnt figure out if this can be done or not. Consider the following case 1. There is a Master detail Relation 2. Primary key in master table is generated using sequence 3. This generated id will also be used in detail table In order to do above scenario, I have to take following steps (Correct ...

26. DB2 390 Dialect and Sequences    forum.hibernate.org

This happened on 3.2.0 and 3.2.5. I couldn't get Sequence to work with DB2 390 (Z/OS). Here is the exception: com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -142, SQLSTATE: 42612, SQLERRMC: null According to the DB2 doc, this means "The SQL Statement is not supported". Reviewed the error messages with the DBA, it looks like the SQL statement that Hibernate is trying to ...

27. Mapping file with more than one sequence key    forum.hibernate.org

Hello, I have a special scenario where I have more than one Sequence generated key on my table. My table in the oracle database has the following fields CUST_AFFILIATION_ID PRE_REGISTRATION_ID LAST_UPDATE_TMSTMP LAST_UPDATE_USER_ID where CUST_AFFILIATION_ID is the primary key on the table, and a sequence generated key. So in the hibernate mapping file, I use ...

28. Strange sequence behavior    forum.hibernate.org

I can confirm this problem when using field annotations. With the following Annotations Hibernate uses SequenceHiLoGenerator. @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "XXX") @SequenceGenerator(name = "XXX", sequenceName = "XXX_ID_SE") private long id; 2008-02-19 13:54:48,164 [main] DEBUG - select XXX_ID_SE.nextval from dual 2008-02-19 13:54:48,773 [main] DEBUG - Sequence identifier generated: 1748 2008-02-19 13:54:48,773 [main] DEBUG - about to close PreparedStatement (open PreparedStatements: 1, globally: ...

29. More than one hibernate sequence for two table?    forum.hibernate.org

In my project I have to write work flow trace to a history tables. As it may grow exponentially, I would like to use a separate sequence. And this table has no relation with other entities. So can I have more than one sequence in my hibernate mappings. I need one to generate ids when entities are saved. And the other ...

30. TableGenerator vs Native Sequence in Oracle    forum.hibernate.org

33. PostgreSQL SERIAL data type (INTEGER + SEQUENCE)    forum.hibernate.org

...

34. Sequence returning huge number    forum.hibernate.org

I am using Oracle 10, Hibernate 3.0 with JPA and Spring. I am using annotations for hibernate mapping and mapped Id as: @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="OTB_DATA_POINTS_SEQUENCE") @SequenceGenerator(name="OTB_DATA_POINTS_SEQUENCE", sequenceName = "BOOKER.OTB_DATA_POINTS_SEQUENCE") @Column(name = "ID") public Long getId() { return this.id; } When I get next value from the sequence manually using SQL it returns a number in billions (which is correct), but when ...

35. ORA-01002: fetch out of sequence    forum.hibernate.org

We are also experiencing the "ORA-01002: fetch out of sequence" problem with Hibernate 3 running with Liferay portal. This is a critical problem for us. Every help is greatly appreciated. This is the jboss datasource we're using: jdbc/LiferayPool jdbc:oracle:oci8:@lportal false oracle.jdbc.OracleDriver **** **** 5 and there are hibernate settings: hibernate.cache.use_query_cache=true hibernate.cache.use_second_level_cache=true hibernate.cache.use_minimal_puts=true hibernate.cache.use_structured_entries=false #hibernate.cache.provider_class=org.hibernate.cache.NoCacheProvider ...

36. Trigger instead of hibernate_sequence in Oracle    forum.hibernate.org

Hi all, my web application use SqlServer2005 and Oracle9i as RDBMS In SqlServer the PK of tables use identity fields. In Oracle the PK of tables use triggers to increment their values. The mapping is the follow: ... @GeneratedValue(strategy=GenerationType.AUTO) ... In SqlServer is all right, but in oracle Hibernate try to use a default "hibernate_sequence". I don't want use it, because ...

37. Help needed for Native sequence and lazy as false    forum.hibernate.org

Hi all, i am new to Hibernate and i need your help in peculiar situation i am facing. I am having a mapping file which has lazy="false" at class declaration level and employs native sequence generator from database i.e, sequence is present in the database which provides next id. Our application whenever is creating an instance of this particular class say ...

38. Cross Database Identity/sequence generation usingannotation    forum.hibernate.org

@ID @GenericGenerator(name="pid-ul", strategy="[b]native[/b]", parameters = { @Parameter(name="sequence", value="ul_seq_id") } ) @Column(name = "USER_LICENSE_ID", unique = true, nullable = false, precision = 22, scale = 0) @GeneratedValue(generator="pid-ul") public long getUserLicenseId() { return this.userLicenseId; } ...

39. HXTT Text trial : SEQUENCE-generated ID always the same    forum.hibernate.org

Hi all, I have to save objects to flat files (CSV) for a gigantic import in a database (test data injection). As Hibernates' documentation asserts it is possible with HXTT's driver and dialect, I am trying (I already have all the HBM files, so it is easier for me to do it like that). If I try a basic test, I ...

40. could not get next sequence value    forum.hibernate.org

Newbie Joined: Wed Mar 12, 2008 4:31 am Posts: 1 Hi, When I try an example on hibenate, I get the following error! Quote: 16:42:09,328 ERROR JDBCExceptionReporter:78 - ORA-02289: sequence does not exist org.hibernate.exception.SQLGrammarException: could not get next sequence value at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:96) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:99) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70) at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507) at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499) at ...

41. SEQUENCE Oracle IdentifierGenerator    forum.hibernate.org

Hi, i want to use SEQUENCE Strategy to primary key generation. For this, i use the following in my mapping file : SEQ_T_UTILISATEUR and i have the following exception : org.springframework.orm.hibernate3.HibernateSystemException: this id generator generates long, integer, short or string; nested exception is org.hibernate.id.IdentifierGenerationException: this id generator generates ...

42. Knowing the next number of a sequence    forum.hibernate.org

Hi ppl, I have a strange doubt. I need to insert in two tables. One of them has a sequencial primary key. Ok till them, but i need to insert in other table with a composite key. One of the composed fields must have the same value of the primary key given to the first table. So... i have two possibilities. ...

44. Hibernate Sequence problem, GenerationType.AUTO    forum.hibernate.org

Hibernate version: 3 Name and version of the database you are using: Oracle 10 All, I have a real problem with hibernate sequence. The developer before me used one hibernate_sequence for ids in all tables (GenerationType.AUTO). The problem is it's a system logging customer usage, inserting thousands of rows a day. Because all rows share the same sequence in Oracle, ids ...

46. Valued pulled from sequence not being used as ID    forum.hibernate.org

47. StoredProc with "sequence-identity" generator ( sq    forum.hibernate.org

I want to override Hibernate's default insert statement by calling an Oracle stored procedure, and at the same time use the "sequence-identity" generator for the ID. Here's a snippet of my Mapping file... Code: ...

48. Using Oracle10g and Sequences    forum.hibernate.org

hi forum, i have a question about the right annotaion for using a sequence as a generator for an id. @Id @Column(name = "ID", nullable = false, unique=true) @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="HIB_SEQ") @SequenceGenerator(name="HIB_SEQ",sequenceName="USERS_SEQ") this is my implementation, the sequences name in db is USER_SEQ the problem is that hibernate uses a own sequencegenerator and the returning id for an insert is wrong. is the ...

49. ID generator for legacy database using oracle sequence    forum.hibernate.org

I am using JPA under JBoss Seam. I am working on a legacy database schema. The table has varchar2 as the primarykey data type. Even if the datatype is varchar2 the content of that column is always integer type. The legacy application is generating the primary on its own. I am trying to use the Generator Sequence strategy to generate the ...

50. 3.2.6.ga sequence genration starts with 0    forum.hibernate.org

51. Two Questions : Sequence and Persistence.    forum.hibernate.org

First : I am trying to create a sequence based id in order to increment automatically. What i am wondering is that will it work ? i am creating : Code: @Entity @SequenceGenerator( name="SEQ_STORE", sequenceName="my_sequence" ) public class Store implements Serializable { private Long id; ...

52. DB2-SEQUENCE and @SequenceGenerator    forum.hibernate.org

@Entity @SequenceGenerator(name="mySequence_PRODUCT", sequenceName="mySequence", initialValue=10, allocationSize=1) @Table(name = "PRODUCT") public class Product implements Serializable{ ... @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="mySequence_PRODUCT") @Column(name = "ID_PRODUCT", nullable = false, insertable = true, updatable = true, length = 10) ...

53. java.sql.SQLException: ORA-02289: sequence does not exist    forum.hibernate.org

Author Message sherihan Post subject: java.sql.SQLException: ORA-02289: sequence does not exist Posted: Mon Jun 16, 2008 12:09 pm Beginner Joined: Tue Dec 21, 2004 3:18 am Posts: 32 Hello, I'm using hibernate 2 with Spring 2 and Oracle 9i to create a web application. I'm getting the following error when trying to save an object. Quote: org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: ...

54. Id mapped to a sequence returning me Integer    forum.hibernate.org

Hi All, Iam getting the following Exception: Caused by: org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class java.lang.Long, got class java.lang.Integer My java class is as below : public class PartyAddress implements Serializable { /** attribute to store the relation between party and address. */ private Long partyAddressId; ......... .......... } My Mapping of the ID is as below:

55. Problem with sequence generation in Oracle9i Hibernate3 env.    forum.hibernate.org

This involves sequence generation in an Oracle 9i / Hibernate3 (hibernate3.jar) environment. The allocationSize attribute of the SequenceGenerator annotation is acting as a multiplier instead of an incrementer. That is, if the last_number field of a sequence is 100,000, upon first usage hibernate is generating id values that begin at 50 * 100000 or 5000000 (i.e. 5000001, 5000002, 5000003,...). The "50" ...

56. JPA, Hibernate and Oracle Sequence Issue    forum.hibernate.org

I don't know if anyone has encountered this issue before, but using the following annotation for the primary key in oracle, which seems to be the preferred solution if you search the web, hibernate doesn't use the value of MY_SEQ.NEXTVAL, but generates some other computed id, even though it increments the value of MY_SEQ. For instance, the value of MY_SEQ.NEXTVAL would ...

57. hibernate reverse engineering and oracle sequences    forum.hibernate.org

If you use the following configuration in the hibernate reverse engineering file to generate annotations for an entity you get the following annotations: MY_SEQ @Id @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="sequence") @SequenceGenerator(name="sequence",sequenceName="MY_SEQ") private long id; However, this doesn't work properly for an oracle database (see my previous post) unless you add allocationSize=1 to @SequenceGenerator. Does anyone how ...

58. HSQLDB Sequence problem by fetching the next value    forum.hibernate.org

Hi all, I am having trouble on getting the sequence mechanism work for HSQLDB. So here are the versions I use: Hibernate-Version: 3.2.2.ga HSQLDB: 1.8.0 The story is like this; I created a sequence in my database using this line of code: Code: CREATE SEQUENCE MIT_SEQ AS INTEGER START WITH 1 INCREMENT BY 1; I have an entity named Mitarbeiter. So, ...

59. oracle sequence for not id property    forum.hibernate.org

Hi, I have a requirement like i need to use the value generated by oracle sequence for a property. eg: Code: Class Test{ private String testId; private String testName; private String testingEntityId; private String testSeqNum; ..... setter and getter methods..... } mapping file... ...

60. Oracle 10g/9i dialect sequence not created    forum.hibernate.org

Hello, I am quite new in hibernate and I face the following issue. I am using an oracle 10g database. In my hibernate class, I specify to create the id in auto mode and for oracle, hibernate create a sequence. The software I use needs several instance of databases with the same tables and sequences. I create a first instance successfully, ...

61. Generator class sequence-identity    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.2.6 Mapping documents: Code between sessionFactory.openSession() and session.close(): Full stack trace of any exception that occurs: Name and version of the database you are using: The generated SQL (show_sql=true): Debug level Hibernate log excerpt: Problems with Session and transaction handling? Read this: http://hibernate.org/42.html Working with Hello World Example of ...

62. Hibernate / JPA using wrong sequence values with PostgreSQL    forum.hibernate.org

I have two projects-- one a JBoss application, one a standalone Java application-- that both use the same JPA entities (Hibernate 3.3.1GA, Hibernate Entity Manager 3.4.0GA, JBoss 5.0.0.CR2). Both apps use the same orm.xml file (we use xml mapping instead of annotations because we have to support multiple databases). The entities are mapped as follows in the orm.xml file: Code: ...

63. Generated non-id value by sequence    forum.hibernate.org

64. sequence generator on save    forum.hibernate.org

65. Hibernate Validator and Oracle Sequence    forum.hibernate.org

Hello all: I'm trying to setup and use Hibernate Validator. I am using an Oracle Sequence to generate the value for the primary key on one my EventCategories table. As far as I can tell, I think I have it all setup to use Validator correctly. The problem I am having is that an Oracle Sequence number is being generated even ...

66. how to use Postgres Sequence in hibernate ????????    forum.hibernate.org

hello i facing a strange problem in my code.. first little bit explain my DB i have Postgres DB in which have table Client,.. Client atble have fields like clientID *sequence ClientName *Filed ClientEmail *Primary Key now in hibernate i want to assign the generator name in the field ClientID i using in Annotation fr mapping bt when i do that ...

68. how to use sequence in postgresql    forum.hibernate.org

hello i facing a strange problem in my code.. first little bit explain my DB i have Postgres DB in which have table Client,.. Client atble have fields like clientID *sequence ClientName *Filed ClientEmail *Primary Key now in hibernate i want to assign the generator name in the field ClientID i using in Annotation fr mapping bt when i do that ...

70. Switching between @GeneratedValue(AUTO) and sequences    forum.hibernate.org

I would like to know if it is possible (and how) to switch from a @GeneratedValue(AUTO) annotation to sequences, without changing the source code. The scenario is this: I have an application that must run on different databases - like MySQL and Oracle -, and by default the code was written using @GeneratedValue(AUTO), which works for MySQL. However, for Oracle (and ...

71. Sequence fails when using two databases in Hibernate    forum.hibernate.org

Thank you for your responses. As suggested if I use 'native' or with annotations 'strategy = GenerationType.AUTO' it works fine. But the problem is my dao's use different session factories and each session factory is configured to use their respective datasources. Infact in my test application I dont have a DAO which used Sybase. But the minute I add the sybase ...

72. How to get a non-ID generated sequence value?    forum.hibernate.org

I want to be able to store and fetch a counter value from my database which starts at zero and goes to Integer.MAX_VALUE. I want to be able to get the latest value and then have the value incremented so that the next time it is fetched it will equal (previous value + 1). It's not clear to me how I ...

73. problem with     forum.hibernate.org

Regular Joined: Wed Jan 28, 2009 8:31 pm Posts: 54 Hi I have a problem with generator sequence this is my hbm Code: ...

74. ORA-02289: sequence does not exist    forum.hibernate.org

Newbie Joined: Fri Mar 13, 2009 2:56 pm Posts: 2 I have an issue with getting a sequence value from Hibernate. When it runs the sequence query Oracle 10g says it doesn't exist, but if I turn on the print sql option and run the same query in the 10g web interface it works fine. Also I checked the sequence in ...

75. ORA-02289: sequence does not exist    forum.hibernate.org

Hi, I have written a sample hibernate program. Hibernate version: 3.3.1 Mapping documents: false mapping class file: package com.base; import java.io.Serializable; ...

76. How to assign identificator with sequence    forum.hibernate.org

Hello...I have a simple question, but I really don't know how to solve it. I'm using this generator 100 UserSequence The sequence starts at 100 on purpose, because I need to insert some users with pre-defined ids (admin == id - 0)...and that is the problem...I have sequence, so I cannot save it, because I have ...

77. Problem with Oracle sequence generator in a SubClass    forum.hibernate.org

@Entity @Inheritance(strategy = InheritanceType.JOINED) @DiscriminatorColumn(name = "dType", discriminatorType = DiscriminatorType.INTEGER) @DiscriminatorValue(value = "0") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class TrxLog implements Serializable { private int id; private String trxCode; @Id @SequenceGenerator(name = "id_sequence", sequenceName = "sq50") @GeneratedValue(strategy = GenerationType.AUTO, generator = "id_sequence") public int getId() { return id; } public void setId(int id) { this.id = id; } public String getTrxCode() { ...

78. Use of sequence without creating an entity    forum.hibernate.org

hi, I already have created a sequence in the database. I want to use it to fill an ID field (auto-incremented then) of a table. I did not create an entity for that table (i have to use a specific API to insert data into that table). How can i get that sequence in Hibernate and use it to set the ...

79. access sequence    forum.hibernate.org

Hi, I have a sequence, my_seq, in a db2 database. I try to access it by means of Hibernate native sql. However, I always get the following hibernate exception. org.hibernate.QueryException: addEntity() or addScalar() must be called on a sql query before executing the query. As per the exception, I should add addEntity/addScalar to the sql statement. However, I don't know the ...

81. Override Generator (sequence) on session.save()    forum.hibernate.org

82. Cascade - Sequence Of Operations ?    forum.hibernate.org

Hibernate Collection is set to cascade = "all-delete-orphan". Out of the objects in the collection some of them need to be updated and some will get deleted. Hibernate is firing update of the objects first before delete. Because of the update getting fired first some of the integrity constraints are failing as update is expecting the deleted objects not to be ...

83. getting next value of sequence    forum.hibernate.org

hi, I want to use next value of a sequence so that i can assign this value to an attribute in my object before persisting it in database. I can't use as this attribute is not the primary key for my table and i am already using uuid for the same table. When i create my HQL ...

84. Override sequence generator with value?    forum.hibernate.org

85. Issue in Sequence    forum.hibernate.org

All, I have the below sequence ,but the PMT_ID are not getting generated properly. PMT_ID should start from 1 and increament by 1 as per the below sequence,but actually when i process the data the PMT_ID are generated like 1,2,6,11,16,21,26,,31,36,41 etc. Please help me out in resolving the issue CREATE SEQUENCE ABC.PMT_ID AS INTEGER START WITH 1 INCREMENT BY 1 NOMINVALUE ...

86. Prefix a sequence    forum.hibernate.org

Hello. I just started using Hibernate (via Seam) and I need some help with an issue regarding id generation. I have an Oracle table with a PK that is a value taken from a sequence and prefixed with a character. For example, if the next sequence value is 1234, I need to assign to the ID column (my PK) the value ...

87. hibernate sequence    forum.hibernate.org

89. [SOLVED] SEQUENCE - entity id with different value from DB    forum.hibernate.org

I need a help for a question: I use postgresql sequence mapped with annotation hibernate/jpa. The hibernate returns a value like 3800, but the postgresql sequence have a value like 75. I never see this before. when i execute the follow method three times: Code: public Integer inserir(CargoTerceirizado cargo) throws DAOException { ...

90. @ManyToMany Sequence Generator    forum.hibernate.org

Hi, Is there a way to describe a generated id value to @ManyToMany annotation? For example: I have a table A and table B, and a table A-B which holds many-to-many relations between A and B. In addition A-B table has a generated id field. I could not find a way to specify this generated id value in the annotations.

91. Problem with sequence generation in Oracle    forum.hibernate.org

I am Newbie to Hibernate.I have a table with primary key as autogenerate column. I have given my mapping hbm file below seq_test .... ..... My class contains:- private long id; public long getId() { return id; } public void setId(long id) { ...

92. Hib not calling sequence.nextval, calling function instead??    forum.hibernate.org

I have a hibernate mapping with a sequence mapped like so: The db has a HIBERNATE_SEQUENCE defined and I can insert rows using this sequence via sqlplus In the output below, hibernate is trying to perform a function call instead of a select hibernate_sequence.nextval from dual which I would expect. What am I doing ...

94. sequence / ID generation problem    forum.hibernate.org

Hi All, We are using Postgres 8.X as DB, JBOSS 5 as app server. Most of our primary keys in tables are defined as serial type in DB and generated through Postgres sequence. id defination in code looks like this @Id @SequenceGenerator(name="wilshire_seq", sequenceName="wilshire_transactions_id_seq") @GeneratedValue(strategy =GenerationType.SEQUENCE,generator="wilshire_seq") @Column(name = COLUMN_ID, unique = true, updatable = false, nullable = false) private Integer id; I ...

97. how to find which objects use hibernate_sequence    forum.hibernate.org

98. Problem when using generator class sequence    forum.hibernate.org

Hi, I am new to hibernate and this is my second post here. I need help for using generator class "sequence" in primary key identifier mapping of my table. My confusion is, do I have to create the sequence I mention for parameter name manually in the database? As I was not sure, I have created my sequence manually. I think ...

99. id generation with Oracle sequence    forum.hibernate.org

I am using Hibernate 3.3.2 with Oracle 10g. On all my tables, I use an Oracle sequence to create my Primary Key. To improve the performance, I have started using the pooled optimizer, because I wanted also to be able to use the sequence through SQL while my application is running. To be consistent, I use the same increment size for ...