1. Cascade using custom id generator failed in stackoverflowerr forum.hibernate.orgNewbie Joined: Mon Oct 16, 2006 10:36 am Posts: 14 Location: Fort Worth, TX This strange issue was encountered on this env: Hibernate: 3.2.0 cr2 Oracle: 9i and 10g db Application: Web & ejb jdk: 1.5.6 The stackoverflowerror does not seem to be related to db and jdk or the development pattern. The issue is from a save operation on an ... |
2. Hibernate Error(could not instantiate id generator) forum.hibernate.org |
3. Some questions (generator for autoincrement,collection i...) forum.hibernate.orgAuthor Message mican Post subject: Some questions (generator for autoincrement,collection i...) Posted: Thu Jan 04, 2007 3:41 pm Beginner Joined: Thu Jan 04, 2007 5:44 am Posts: 26 Location: Innsbruck - Sivas(TR) - Bregenz Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3 Mapping documents: Code: |
9. increment generator question forum.hibernate.orgHi, I want to add the generator tag in the mapping file. I want to give increment class. What should be the parameter i need to use if i want the id start with 100 since by default it start with only 1. |
10. Accessing the 'native' id generator forum.hibernate.orgHibernate version: 3.2.2.ga Hi, I have had a look through the forum and tried to find an answer to my question, but have failed thus far (I am thinking that it may not be possible, but I should at least ask). The application I am currently working on is implemented using native for id generation. I had to create a custom ... |
11. hibernate code generator forum.hibernate.org |
12. Generator class SELECT using multiple properties forum.hibernate.orgI'm trying to map a legacy system that uses triggers to generate the primary key. I know that to be able to retreive the primary key I have to use the select generator and assign to it a unique value property. This is similar to the one shown below. Code: |
13. how to write own id generator class? forum.hibernate.org[b]3.0[/b] Hi, Most of our DB tables are having Composite-IDs.we r using own sequence generator logic. we have Id_Generator table which contains other tables as argument. [b]Id_Generator table TBName next_no delete_Flag Row_Version_No Advance 1 1 0 Product 3 1 2 [/b] I want to write a generic IDGenerator class and send tablename as argument from .hbm file. Can any one help ... |
14. custom Identifier Generator forum.hibernate.orgHibernate version: 3.2.2 GA We are using an hibernate custom generator to generate primary key values for all tables in the application. We are working with a legacy database schema and the custom id generator retrieves an integer value from a table in the database and uses that value to generate the primary key after applying a customized logic to the ... |
15. Stored Procedure and Custom Identifier Generators forum.hibernate.orgHello, I've got to integrate to legacy database. For inserting, I have to rely upon a Stored Procedure which outputs the generated Primary Key as parameter. I've tried to write my own StoredProcedureGenerator extending AbstractPostInsertGenerator. My problem is that I cannot use the configured |
16. hilo generators max_lo forum.hibernate.orgHi, I have a couple of tables that use the same table to get the hilo sequence generator number for its ID column. The underlying db is AS400. All of them have it defined like this: |
17. replacement of increment |
18. Before Insert Trigger and ID generator forum.hibernate.orgEDIT (2011/01/21): * See here for the latest version of the code (Hibernate 3.6.0.Final). * See here for how to use with annotations. * See here for how to declare it at package level when using annotations. * See here for a bug in Oracle 10.2.0.0 to 11.1.0.7 that may prevent a correct working of this code. I am using a ... |
19. Question about generators and PostgreSQL forum.hibernate.org |
20. I am looking for help about hibernate ID Generator. forum.hibernate.orgpublic class MyIdGenerator implements IdentifierGenerator { public Serializable generate(SessionImplementor session, Object object) throws HibernateException { // Use your logic here. For example, I am using a sequence SessionImpl sessionImpl = (SessionImpl) session ; BigDecimal id = (BigDecimal) sessionImpl.createSQLQuery("select my_sequence.nextval from dual").list().get(0) ; return "P" + id.toString() ; // format it as required } } |
21. Which Generator Class to Use? forum.hibernate.orgpublic class MyIdGenerator implements IdentifierGenerator { public Serializable generate(SessionImplementor session, Object object) throws HibernateException { // Use your logic here. For example, I am using a sequence SessionImpl sessionImpl = (SessionImpl) session ; BigDecimal id = (BigDecimal) sessionImpl.createSQLQuery("select my_sequence.nextval from dual").list().get(0) ; return "P" + id.toString() ; // format it as required } } |
22. [help]flexibility of id-generator for different sql dialects forum.hibernate.orgHi all, Our development requires to change database instances back and forth between Oracle10g and SQLServer. My question is, is there a way of some sort of conditional statement that allow multiple id-generator? or something that will take a parameter of the database type?? here's a snippet of my mapping file: |
24. Core 3.2.4 "native" id generator no longer works forum.hibernate.orgi get same problem on update/insert on hiber 3.2.4 error message = statement parameter not set i do not use any id generator. i use auto increment by db. my app works ok on hiber 3.2.2 by the way is there any real advantage using id generator instead of auto inc by db? |
25. key-property and generator forum.hibernate.org |
26. Hibernate Annotations no "Assigned" generator type forum.hibernate.orgA question that has been bugging me. Here is an example... I have two tables (Mysql v5.1): TABLE1: client FIELD: case_id; int(11), Primary Key, Not Null FIELD: client_name; varchar(255) TABLE2: clientlog FIELD: clientlog_id; int(11), Primary Key, Not Null, Auto Increment FIELD: case_id; int(11) KEY `client_index` (`case_id`), CONSTRAINT `clientlog_ibfk_1` FOREIGN KEY (`case_id`) REFERENCES `client` (`case_id`) ON DELETE CASCADE So a client can ... |
27. Using a Generator independently of later insertion forum.hibernate.orgfinal Session session = sessionFactory.getCurrentSession(); session.beginTransaction(); txid = /* get new unique id from Hibernate */ resp = sendSoapRequest(txid, ....); processSoapResponse(resp); Tx aTx = new Tx(); aTx.setId(txid); ... ... |
28. Editing an existing ID without generator forum.hibernate.orgHello I have a small problem. I got a table in my database that contains an ID which is manually assigned (it is inserted through a form id input field that a user types). Now I want to change this ID but Hibernate does not want to update the id attached to the object. I assume this is because Hibernate does ... |
29. id generator forum.hibernate.orgI am confused as to the different class values for the generator element necessary for id's in the mapping file. I was trying to navigate through the first hibernate tutorial(http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html). The table Events has its id with a native generator: Code: |
30. id generator forum.hibernate.orgI am confused as to the different class values for the generator element necessary for id's in the mapping file. I was trying to navigate through the first hibernate tutorial(http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html). The table Events has its id with a native generator: Code: |
31. JPA/Hibernate's pk generator strategy with PGSQL issues forum.hibernate.orgI posted this in the JBoss forum's but came upon this more active Forum with respect to JUST hibernate. So here goes: The default strategy is AUTO which according to the HibernateExt annotation processor dwindles into a "native" which eventually leads the EntityPersister handling these entities (such as the SingleTablePersister) to use the SequenceGenerator because the PostgresDialect's getNativeIdentiterGenerator returns this class ... |
32. Problem with NATURAL id generator and SQL Server 2005 forum.hibernate.orgHi, I've already used Hibernate for a while, but this is my first time when I have a problem which I cannot solve by re-reading the relevant part of the manual. (Searching this forum didn't return any thread on a similar problem, I've only found with google another person asking about a very similar thing but without replay at: http://saloon.javaranch.com/78/001083.html ) ... |
33. generator "hilo" and primary key issue forum.hibernate.orgHello, I have parent class with id as follows: |
34. Generator Increment Problem forum.hibernate.orgHi, I am quite new to Hibernate. I have set the PK of database as Generator Increment type. Suppose i have 5 rows and i add one row then the ID is set to 6 which is correct. Now i delete 6th row so there are only 5 rows in the table with ID values 1 to 5 and i commit ... |
35. Oracle PK Generator should supply byte Array forum.hibernate.orgHi! I'm using Hibernate 3 with a Oracle 9i Database. In the following mapping file i use a generator with the guid class, that loads the generated primary key from the DB. Code: |
36. increment generator class throwing StaleStateExceptions forum.hibernate.orgI just want to put up some information on a problem that had us by the ears for a bit so that others might not have to work through it as well. The context is a multithreaded Java SE app using spring and hibernate running against an Oracle 9i and 10g DB. To make a long story short, the app reads ... |
37. steps for creating an userdefined generator for mysql forum.hibernate.org |
38. steps for creating an userdefined generator for mysql forum.hibernate.org |
39. steps for creating an userdefined generator for mysql forum.hibernate.org |
40. Identifier Generator forum.hibernate.org |
41. Hibernate |
42. ID Generator Failing with PostgreSQL 8.1 forum.hibernate.orgHey all, I got great help asking here last time, so I'm back. Here's my question. I recently upgraded to PostgreSQL 8.1.9 from 7.4, and bumped up my JDBC driver accordingly. However, now on inserting into the database, I get this error. Code: 2007-10-24 01:53:09,948 WARN [org.hibernate.util.JDBCExceptionReporter] - SQL Error: 0, SQLState: 23502 2007-10-24 01:53:09,948 ERROR [org.hibernate.util.JDBCExceptionReporter] - ERROR: null value ... |
43. Using Oracle and enhanced table generator forum.hibernate.orgI am trying to use the enhanced table generator with Oracle 10g. When initializing the database I get an error about not being able to instantiate an id generator. It works fine against mysql. The reason I am doing this is that I am using union-subclasses and was having problems with just using native for the id generators did not work. ... |
44. MSSQL 2005 / generator class="foreign" forum.hibernate.org |
45. Foreign key generator problems forum.hibernate.orgHi all, I tried searching using the google technique, I didn't get any good results. I can't seem to figure out how to map |
46. Custom ID Generator forum.hibernate.orgHello, I have a custom id generator that I built. However, there are cases where I want to assign an id to an object myself and not have the idgenerator provide a value. Is there a way to do this? Essentially, I want to override the idgenerator if an id has already been provided. thanks for your help. |
47. Problem with generator class="increment" using sch forum.hibernate.org |
48. Hilo ID generator with multiple hibernate clients forum.hibernate.orgHi All, I would like to use a same tool on different computers (so different jvm) which saves data to a Derby database setuped in server mode (not embedded). This tool uses Hibernate version 3.2.0.ga and a HILO ID generator for several tables. Can the tools on different computers generate a same ID due to the HILO generator, and thus create ... |
49. supress id generator class during reverse engineering forum.hibernate.orgthe default strategy for rev eng a table with a compound primary key is to create an id generator class which contains the constituent columns. the main class then contains a reference to that id generator class. I don't want to loose these columns from the main class. I would rather have the primary key not represented at all in the ... |
50. How to define and get ID-Generator for manual ID generation forum.hibernate.org..... private VerifiedMark verifiedMark; public void setStatus(String status) { this.status = status; if ("Verified".equals(status) && verifiedMark==null) verifiedMark = new VerifiedMark(); } public int getVerifiedId() { if (verifiedMark==null) return 0; else return verifiedMark.id; } ... |
51. ClassCastException when the generator is native forum.hibernate.orgHi, new to Hibernate. just started exploring. iam having the problems with my first example. Version: Hibernate 3 Database: Oracle 10g Emp.cfg.xml: |
52. changing generator class at runtime forum.hibernate.org |
53. Hibernate Code Generator buggy ? forum.hibernate.orgI used "Hibernate Code Generator Dialog" to generate DAO classes with this configuration: Code: |
54. IdBag and db2 Identity generator forum.hibernate.org |
55. id generator interchangeability between MySQL and Oracle forum.hibernate.org |
56. Hibernate3 MySQL best id generator forum.hibernate.org |
57. What is the strategy for changing ID Generators on live data forum.hibernate.orgHello. I have an application in production that was my first live fire use of hibernate. I did not read enough about id generators at the time and used INCREMENT. Now I need to enable a secondary process to modify these tables and so need to move away from INCREMENT. What is a good strategy for changing the id generator on ... |
58. Generator used for id generation. forum.hibernate.orgHi all, I am using Hibernate to migrate data from DB2 to oracle. I am using |
59. How do I configure hibernate to use a table generator other forum.hibernate.org@Id @GeneratedValue(generator="hibseq") @GenericGenerator(name="hibseq", strategy = "org.hibernate.id.enhanced.TableGenerator", parameters = { @Parameter(name="initial_value", value = "1"), @Parameter(name="table_name", value = "hibernate_sequences") } ... |
60. Custom Identifier Generator For String Column But no seq num forum.hibernate.orgHibernate version:3.1 DB2 How to generate a Id for String column? I have written one custom generator class which extends TableHiLoGenerator There is no seq number for that column. But I got Exception like.. org.hibernate.exception.SQLGrammarException: could not get or update next value at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.engine.TransactionHelper$1Work.doWork(TransactionHelper.java:41) at org.hibernate.engine.transaction.Isolater$JdbcDelegate.delegateWork(Isolater.java:153) at org.hibernate.engine.transaction.Isolater.doIsolatedWork(Isolater.java:38) at org.hibernate.engine.TransactionHelper.doWorkInNewTransaction(TransactionHelper.java:51) at org.hibernate.id.TableGenerator.generate(TableGenerator.java:94) at org.hibernate.id.TableHiLoGenerator.generate(TableHiLoGenerator.java:61) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:91) at ... |
61. Table generator reconfiguration to avoid ID "Jumps" forum.hibernate.org |
62. Downside to accessing identity generator directly for JDBC ? forum.hibernate.orgIs there any downside to using identity generator directly using code such as... Code: EntityManager em = ...; HibernateEntityManager hibEM = (HibernateEntityManager) em; Session session = hibEM.getSession(); SessionFactoryImpl sessionFactoryImpl = (SessionFactoryImpl) session.getSessionFactory(); IdentifierGenerator identifierGenerator = sessionFactoryImpl.getIdentifierGenerator("com.company.business.aim.instance.Instance"); long hibernateId = ((Number) identifierGenerator.generate((SessionImplementor) session, null)).longValue(); For certain functionality in our application, an extremely large number (in the millions or 10s of millions) of ... |
63. Foreign key generator on property element? forum.hibernate.orgNeed help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3 Name and version of the database you are using: MySQL 4.1.9 I have the following two tables user: Fields include userId BIGINT and standard user type fields userrole: Fields include userRoleId BIGINT Primary (auto increment) userId BIGINT index roleId BIGINT index I want the association of user to ... |
64. ID generator performance advice ? forum.hibernate.orgHellu all, Which ID generator performs "faster"... ? I mean: you have the hibernate sequence ID generators that get the ID from the db, but you also have the UUID generators.. I picked up some signals on the serviceSide website, that generating UUID in your application tend to be a performance bottleneck. Can't really see why... So please some feedback on ... |
65. Customer ID generator forum.hibernate.org |
66. joind class use Id generator throw duplicate entry error forum.hibernate.orgAuthor Message wuhaixing Post subject: joind class use Id generator throw duplicate entry error Posted: Wed Jun 18, 2008 9:38 pm Newbie Joined: Wed Jun 18, 2008 8:45 pm Posts: 2 Hibernate version: hibernate-3.2.6.ga hibernate-annotations-3.3.1.GA hibernate-entitymanager-3.3.2.GA hibernate-search-3.0.1.GA hibernate-validator-3.0.0.GA Mapping documents:I use annonations in package-info Code: @GenericGenerator( name = "IdGenerator", strategy = ... |
67. Doubts in Hibernate key generators. forum.hibernate.orgNeed help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.2.5 Name and version of the database you are using: MySQL 5.0.45 Hi All, I read Hibernate key generators from the book Java Persistence with Hibernate. I have certain doubts. 1) native - It says that identity generators picks other identity generators such as identity, sequence or hilo. depending ... |
68. hilo identity generator !!! forum.hibernate.org |
69. How to write custom ID generator? forum.hibernate.orgWell, you can just indicate that you generate the id value by yourself, set the id in your entities, and then the data will be saved with the id you provided. I do worry a little bit about this. You don't want to reinvent the wheel. Most databases provide id generation strategies that have been tried and tested by people much ... |
70. How to reset the ID generators per table forum.hibernate.orgHow can I reset (force) the ID generation to be started from 1 per each table? currently I am using the |
71. Advice: Id Generator seqhilo assigned before first persist forum.hibernate.orgHello, I'm looking for some advice on how to accomplish an ID Generation scheme. I'm quite happy with seqhilo, but a case has arisen where I want the initial ID to be generated before Initial Persisting. Is there an easy way to accomplish this? Also, I'm using a versionId to detect unsaved. Many Thanks! -JD |
72. saveorupdate with assigned generator!! forum.hibernate.org |
73. Bug prevents a native-if-not-assigned custom generator forum.hibernate.org |
74. Globally define ID generator forum.hibernate.org |
75. problem with foreign generator forum.hibernate.org |
76. Cannot insert a record with Id |
77. @CollectionId generator="native" fails forum.hibernate.orgNewbie Joined: Fri Aug 05, 2005 2:56 pm Posts: 11 Hibernate version: 3.2.6 MySQL 5.0.4 I am attempting to persist a Dashboard Entity that contains a collection of column 'value-type' objects but the @CollectionId generator="native" fails. I have tried various generator types all with the same outcome. Is this a bug? Here is the code and the stack trace. I have ... |
78. How does HiLo generator deal with manual inserts/ legacy app forum.hibernate.orgHello, From my understanding of HiLo generator in multiple jvms, each application instance has to be aware of the HiLo table and understand the HiLo algorithm for it to function correctly. For example.. if the HiLo algorithm reserves a set if ids in memory from the HiLo table, how does it deal with a legacy application inserting by using of the ... |
79. problem with |
80. Many to Many Join table with generator ID forum.hibernate.orgHello, Lets say I have a situation with Parent, Child and ParentChild table. Lets also say that ParentChild table has a non-intelligent sequence ID used for its primary key along with the PK of both Parent and Child tables. I want to map the relationship as many-to-many in the config and have the Parent as the driver so that if I ... |
81. Generate different generator class with middlegen? forum.hibernate.orgHi All I am using HIbernate 3.0 and middlegen 2.2 version. I am using middlegen with ant task to generate my pojos and mapping files. In some of tables the primary key is autogenerated and in some it is not. but in middlegen ant i can give only one option standardGenertorScheme = "assigner/native/sequence". so how can i know that if primaty ... |
82. AnnotationException: Unknown Id.generator: platformBeanSeque forum.hibernate.orgPage 1 of 1 [ 1 post ] Previous topic | Next topic Author Message stevebarby2 Post subject: AnnotationException: Unknown Id.generator: platformBeanSeque Posted: Thu Mar 05, 2009 7:23 am Newbie Joined: Thu Mar 05, 2009 4:59 am Posts: 1 Location: Dorking, UK Could someone please help me with an issue that ... |
83. Hibernate generated mappings using assigned generator. forum.hibernate.orgI'm generating hbm.xml mapping files and POJO's using the ant tool in Hibernate 3.3.1.GA. Things are looking good except one thing; the mapping files are all coming out with the ID generator set to assigned. I'm using Postgresql 8.3 as the database and have an existing schema that has the id's linked to sequences. When I add records through PGAdmin the ... |
84. Override increment id generator forum.hibernate.org |
85. Urgent Help regarding MappingException and id generator forum.hibernate.orgDear all i m using Hibernate 3.2.5. i have got all mappings correct , i mean atleast it doesnt give me incorrect mapping error. Except for one class it gives a warning :-- WARNING: composite-id class does not override equals(): payments WARNING: composite-id class does not override hashCode(): payments And then after some hibernate tasks it gives me following line of ... |
86. urgent :-regarding Mapping exception and ID generator forum.hibernate.org |
87. Mapping Exception and id generator error forum.hibernate.orgPosted: Fri Mar 20, 2009 5:49 am Post subject: urgent :-regarding Mapping exception and ID generator Dear all i m using Hibernate 3.2.5. i have got all mappings correct , i mean atleast it doesnt give me incorrect mapping error. I m facing problem with following exception . . . . . INFO: Default entity-mode: pojo INFO: Named query checking : ... |
88. Using a Hibernate id generator outside of Hibernate? forum.hibernate.orgDear all, When I persist an entity I need to know a unique id for it before commiting the transaction. As stated in another thread, the id of an entity can only be obtained via getId() after commiting at least if you want your code to be portable. In order to overcome this, I want to add another field to my ... |
89. Create Identity Generator Programatically? forum.hibernate.orgHere is my scenario. In a production/qa environment I do not want my application to be able to insert into a table (only select/update). For this reason, our POJOs are not annotated with an id generator. On the flip side, I would like to make use of the id generator during unit test execution. Is there a way to programatically add ... |
90. Unknown Id.generator: hibernate-increment forum.hibernate.orghi, i have a problem with the GenericGenerator-GeneratedValue-annotations. When using this simple class Code: import javax.persistence.*; import org.hibernate.annotations.GenericGenerator; @MappedSuperclass @GenericGenerator( name="hibernate-increment",strategy="increment") public abstract class IDobject { protected Long id; @Id @GeneratedValue(generator="hibernate-increment") public Long getID() { return id; } final public void setID( Long id ) ... |
91. problem in |
92. Cannot get an id generator working with annotations & HS forum.hibernate.org |
93. Use Generator increment on a normal property forum.hibernate.org |
94. DB Export/Import: Cannot setId() with "native" id generator forum.hibernate.orgAn important facility in my application is to be able to backup/restore the database via a XML file. Obviously when restoring entities, the primary key values must be preserved. However I cannot figure how to override the native ID generator specified in the mapping file for the purpose of restoring the database. If I remove |
95. error could not fetch initial value for increment generator forum.hibernate.orgNewbie Joined: Wed May 27, 2009 3:21 pm Posts: 1 Hello. I pretty new to using Hibernate. I have inherited a project which I believe worked on the old developers system. I dont know what I am doing wrong. I have for the most part just brought this project into MyEclipse and trying to get it working. Its a pretty simple ... |
96. Problem and fix using enhanced table generator with DB2 forum.hibernate.orgNewbie Joined: Mon Sep 08, 2008 5:19 pm Posts: 5 Environment: Hibernate 3.3.1.GA using DB2Dialect, DB2 UDB 8.2 I wanted to use a custom optimizer with the enhanced table generator. My first test uncovered a problem with the code in org.hibernate.id.enhanced.TableGenerator. The configuration process creates this table by default: Code: create table hibernate_sequences (sequence_name varchar(255), next_val bigint, ... |
97. Generator class for non primary columns forum.hibernate.orgyes thanks for yo reply is it possible to combine two tables with the single formula say for examble i have 3 tables A, B, C B and C are sub tables of A A = id (primary) B = id (primary), requestId(property) C = id (primary), requestId(property) here id is common for all the 3 tables for a record. now ... |
98. code generator forum.hibernate.org |
99. generator for id that has one-to-many reference forum.hibernate.orgHi there I have 2 tables tblParent parentID - primary key description tblChild parentID - primary key + childID - primary key ( composed) description Code: |
100. Lifetime of a custom ID generator forum.hibernate.org |