1. Hibernate ID Generator stackoverflow.comAnyone know of some good tutorials on how to create a custom ID generator for hibernate? |
2. Hibernate |
3. The equivalent of |
4. How to define reusable |
5. Hibernate with Oracle 11g not working with "select" generator stackoverflow.comI am using Hibernate 3.2.5 and Hibernate Annotations 3.3.1.GA as the JPA provider in a data loading application. I have configured Hibernate to use C3P0 for connection pooling. My database is: ... |
6. Is generator="increment" good enough for sequential invoice number? stackoverflow.comI need to write a invoice generating software in ColdFusion 9 using ORM (Hibernate). One of the requirements is that the invoice number must be sequential without gap, which means no invoice ... |
7. Hibernate Code Generator does not generate anything stackoverflow.comI am trying to develop a Wicket-based web application using Hibernate at the model layer with a Postgres DB. I created all my tables manually and I am trying to reverse-engineer the ... |
8. How to define jpa Application level generators stackoverflow.comAs I am using using mysql database and I am using id strategy. @GeneratedValue(strategy = GenerationType.TABLEand I found that using jpa xml can define a application level generator from ... |
9. Random ID Generator, mapping vs. same-column stackoverflow.comThere're a few entities that we wish to hide its exact ID from the customers - the main reason is that, we do not want customers to know how many of ... |
10. Stack Overflow whilst cascade saving nhibernate entity with custom generator stackoverflow.comI'm pretty new to Nhibernate, so apologies for a long - winded description I suspect that changing the structure of the legacy DB is probably the best option, but I want to ... |
11. NonUniqueObjectException migrating to hilo generator strategy stackoverflow.comI have a database with existing data, where previously I've been using AUTO_INCREMENT on the db to generate the PK. To improve performance and facilitate bulk inserts, I'm trying to introduce a ... |
12. Hibernate - How to control generator class used when running hbm2hbmxml stackoverflow.comMy hbm2hbmxml task is generating ids such as below
|
13. Java - JPA - Generators - @SequenceGenerator stackoverflow.comI am learning JPA and have confusion in the |
14. JPA/JDO entity to XML XSD generator stackoverflow.comI am using JDO or JPA on GAE plugin in Eclipse. I am using smartgwt datasource, accepting an xsd. I would like to be educated how to generate an XSD from my jdo/jpa ... |
15. In Grails / Hibernate Can you set the generator to increment only if not assigned? stackoverflow.comis there a way to have hibernate use auto generated ids if it wasn't assigned but use the assigned value if it was? |
16. hibernate generator won't insert with uniqueidentifier stackoverflow.comI'm trying to map an entity using Hibernate Annotations, so that when a record is created and saved (via cascade), an ID is automatically generated. With my current setup (or a ... |
17. hibernate generator tag stackoverflow.comWhat the exact purpose of ' native ' in hibernate mapping file of the generator tag ( I know by using genarator tag, it will genaerate the primarykey values ...) ... |
18. Proper Hibernate id generator for postgres serial/bigserial column? stackoverflow.comMy PostgreSQL tables have id's of type |
19. Hibernate exception while using "identity" generator - how to use stackoverflow.comI am using Hibernate over SQL Server for a web application. I was using the "increment" generator class till now and recently ran into ConstraintViolation exceptions. So, I changed the generator to ... |
20. Problem with auto-generated primary_key using jpa on DerbyDB stackoverflow.comI have jpa annotated entity class like:
|
21. Hibernate |
22. Eclipse complying "Unresolved generator name" but all works fine stackoverflow.comI use a hibernate @GenericGenerator(name="myGenerator") to setup a generator and use it with @GeneratedValue(generator = "myGenerator"). The application runs fine, but Eclipse reports an error of 'Unresolved generator name "myGenerator"'. Is there ... |
23. Identity Generator in Hibernate with Sybase stackoverflow.comI am using hibernate 3.5 with Sybase ASE database.I have a primary key PK1 in my table Table. I used the select generator class for my primary key generation.
|
24. Assigned Generator Class on Hibernate Annotations stackoverflow.comHibernate newbie here. I am working on a simple Hibernate mapping file. When I am using the xml approach, I set the generator class to assigned. There are certain logic that must ... |
25. Is it possible to use generator for any |
26. Hibernate ID generator - Option for both set the id myself, or hibernate generate it stackoverflow.comIs there some Hibernate's primary key generator (as "assigned" or "identity" for example) that I can both set the id myself, or hibernate generate it? |
27. HibernateTools Reverse Engineering tool does not add Annotation for generator stackoverflow.comI have my MySQL DB Schema created and I am using Hibernate Reverse Engineering file to create annotated Domain Object (.java). Though the file is generated correctly, it is somehow missing ... |
28. Saving child objects from union-subclass when shared generator is hilo stackoverflow.comI have two classes in a hibernate mapping like this:
|
29. Problem with hibernate trigger-generated ids (MySQL) stackoverflow.comI'm using before and after insert triggers to generate ids (primary key) of the form "ID_NAME-000001" in several tables. At the moment, the value of the hibernate generator class of these ... |
30. Hibernate ID Generator Confusion stackoverflow.comI am using Hibernate 3.0 in my application with Postgres database. It is a monitoring application and gathers data every minute. So we have thousands of rows in some tables every ... |
31. Hibernate custom proxy generator - Stop equals() from initializing a lazy proxy stackoverflow.comI have entity classes and these entity classes implement their own equals() function, which just compares the Ids of the classes. Sadly, invoking equals() on a Hibernate proxy initializes it, which ... |
32. Hibernate's generator class not really working? stackoverflow.comAsking this question here after hours of frustration with me and my Eclipse. Hoping to find some respite here. I'm trying to save a pojo object into MySQL database via Hibernate ... |
33. how to disable generator when db trigger creates id stackoverflow.comCurrently when I try to insert new records I am getting an error: [ERROR] 05/12/11_09:44:20.54 [org.hibernate.event.def.AbstractFlushingEventListener] - Could not synchronize database state with session Db2 triggers to generate the ID need to remain ... |
34. Hibernate: Custom ID generator needs to persist entity stackoverflow.comI'm implementing a custom Id generator for Hibernate. In my generate-method I need to read from another table and modify data on it. That's (about) the way I would do it:
|
35. Hibernate assigned generator stackoverflow.comThe generator element in the hibernate mapping file is supposed to be used to determine how the primary key is generated. Why is the default value assigned bad for detached and ... |
36. difference between native and increment id generator type stackoverflow.comWhat is the basic difference between when we use |
37. how does hibernate generator increment handle deletes stackoverflow.comThis is how i am using the generator:
The behaviour that ... |
38. hibernate generator increment confict with table auto increment stackoverflow.comI set generator as 'increment' in hbm file, and also i put auto_increment thing in database table also. This creteria showing issue .... This both thing is conflicting ? ... |
39. having trouble making a custom hibernator ID generator stackoverflow.comI am trying to create a class to act as a custom ID Generator for some hibernate entities and am having some trouble. All of the queries I've done on google ... |
40. How to configure table generator for sub classes in hibernate annotation? stackoverflow.comI am creating a app with hibernate as ORM tool and annotations are used for configuring JPA metadata. Now, I am facing some issues with ID generator for entities. My entities ... |
41. What does hibernate do with generator class="native" on oracle db? stackoverflow.comI have this mapping in my code: News.hbm.xml: <class name="xyz.News" table="XYZ_NEWS"> <id name="id" column="NEWS_ID"> <generator ... |
42. generator class="native" is giving error stackoverflow.comWhen I try a save an Object with generator class="native" in hbm.xml so it is giving me error but if generator class="increament thus it works fine. I know the problem is ... |
43. Hibernate union-subclass (table per concrete class) mapping generator of "increment" very slow? stackoverflow.comMy Hibernate hbm file looks something like this with a mysql DB:
|
44. Hibernate gain access to identifier generator object stackoverflow.comI have implemented an identifier generator and added it to a mapping file to be used for a Domain Object. Due to some complicated reasons which aren't worth going into, ... |
45. Test data generator for JPA or Hibernate stackoverflow.comAre there any tools or libraries that can be used to generate test data using JPA or entity beans? I believe this will be very helpful for unit testing where ... |
46. How to prevent Hibernate from using 0 as ID? stackoverflow.comI am using
on Entities and define the ID with
yet Hibernate still uses 0 as an ID.
I cannot use @GenericGenerator because the annotations do not come with Hibernate4 that ships ... |
47. CascadeType.Persist not working with primary key generator type table in JPA stackoverflow.comI have an issue using CascadeType.Persist for my JPA/Standalone project. I have a Parent entity which has a List of Child entities that should be persisted along with the Parent and ... |
48. hibernate generator native class does not increment my user_id column stackoverflow.comi am using the following hibernate mapping file
|
49. JPA Static Metamodel generator with NetBeans 7 + Maven forums.netbeans.org |
50. [Hibernate] Please explain hilo generator coderanch.comI am new to hibernate. I have been able to successfully insert object into my MS SQL database using the hilo generator. The problem is, it is not working like I think it should. Given the tables TICKET and TICKET_SEQUENCE, I see that TICKET_SEQUENCE.ID is being incremented by 1 like it should. TICKET.ID on the other hand, is being incremented by ... |
51. Hibernate Oracle Generator problem coderanch.comI use Hibernate 3.0 and Oracle 10g. When ever I run the code to insert a record into the table I get this error : (I have tried native, HiLo, sequence.... nothing works) Any help will be greatly appreciated. Exception in thread "main" org.hibernate.MappingException: could not instantiate id generator at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:92) at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:151) at org.hibernate.impl.SessionFactoryImpl. |
52. My hibernate generator coderanch.comI wrote my own HBM generator that can be used by everybody else. So if you use MSSQL or MYSQL you can find this generator usefull. This ANT script is a generator for Hibernate mapping files. Generator can create a JAR file that contains set of generated HBM and class files. One HBM file and one class file are generated for ... |
53. problem with Primary Key/ Generator class [Hibernate] coderanch.comHi I have two tables with a one to many relationship. those are company and employees. who share a primary key and a foreign key in the relational database. Now when i try to apply hibernate and put the relationship in the hbm.xml file i feel that the primary key which the company no. is autogenerated. Can there be any solution ... |
54. hibernate MS SQL 2005 generator "native" problem coderanch.comHi! I am getting this exception when i try to use generator class = "native" for my id field in DataBase : org.hibernate.exception.SQLGrammarException: could not insert: [com.test.TempXMLDAO]at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:40) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2108) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2588) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:180) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:108) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70) at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523) at ... |
55. Problem with Hibernate generator increment coderanch.comHi, i have a problem with using the hibernate generator increment for a pk generation. the code of the *.hbm.xml looks like this and in the pojo the passowordId is defined as Long also the getters and setters are defined right. |
56. Unknown Id.generator Hibernate exception coderanch.comI am getting this exeception when i m trying to generate sequence ids with oracle database. @Id @GeneratedValue(strategy = GenerationType.SEQUENCE ,generator="my_seq") @Column(name = "USER_ID", unique = true, nullable = false, insertable = true, updatable = true, scale = 0) public long getUserId() { return this.UserId; } public void setUserId(long UserId) { this.UserId = UserId; } I am getting this exception javax.persistence.PersistenceException: ... |
57. org. hibernate. Annotation Exception: Unknown Id.generator coderanch.comHi, I have my persistance.xml and orm.xml in META-INF folder and both are in classpath in war. persistance.xml -------------------------------- |
58. JPA/Hibernate Generator issues... coderanch.comI'm using JPA Annotations with Hibernate backed by a PostGreSQL database. I've been generally quite happy with how cleanly everything works, but I've had a few complaints over how @GeneratedValue interacts with the rest of the system. Currently I have to do something like: @Entity @Table(name="competitions") @SequenceGenerator(name="competitions_seq",sequenceName="competitions_id_seq") public class Competition { @Id @GeneratedValue(generator="competitions_seq") ... Now I know I can configure a ... |
59. Doubts in Hibernate key generators. coderanch.comHi 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 on the capabilities of the underlying database. It also says to use this when we want to keep our mapping metadata portable. Q. - ... |
60. cannot increment the generator id in HIbernate 3.0 coderanch.com |
61. JPA/Hibernate/Oracle seqhilo generator coderanch.com |
62. JPA Entity Generator Tool coderanch.com |
63. net.sf.hibernate.MappingException: could not instantiate id generator coderanch.comHi, i am new to Hibernate. I am trying to get the current session from the HibernateSessionFactory. I am getting following exception. Could any one kindly help me in this? %%%% Error Creating SessionFactory %%%% 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) at net.sf.hibernate.persister.AbstractEntityPersister. |
64. hibernate to JPA: generator class=increment coderanch.com |
65. Hibernate primary Key/User defined Generator class coderanch.com |
66. generator setting to native in hibernate coderanch.com |
67. Generator Select issue forum.hibernate.orgHi, I am using hibernate 3.1.3 and I want to use the generator class select option. But i get a ClassCastException - java.lang.String incompatible with java.lang.Integer The DB is DB2 on Z/oS v9 and the hibernate cfg that i have written contains - |
68. [SOLVED]hibernate.AnnotationException: Unknown Id.generator forum.hibernate.orgHi! The error is.. Code: init: deps-jar: Compiling 1 source file to /home/bruno/NetBeansProjects/IntroducaoHibernate01/build/classes compile: run: 03/10/2009 00:11:42 org.hibernate.cfg.annotations.Version |
69. How to assign PK manually when generator specified? forum.hibernate.orgHi all, I'm using envers to audit my data and in some cases, I need to restore records that have been deleted. I want them to be restored exactly as they were. This means that the primary key has to be the same too. I tried extending base entity to remove @GeneratedValue, but I got the following error: -Unable to define/override ... |
70. Hibernate ID Generator forum.hibernate.orgHi Dear All, We have three tables, Unit, Asset & LoanAsset. Unit_id & Asset_Id coming as FK and we have to insert into LoanAsset table with generate LS_Id. Look into the below records, "How can we achieve this style of ID generation"???? I will be much thankful to you for cooperation.... Primary Key = Unit_Id(fk) + Asset_Id(fk) + LS_Id Unit_Id(fk) Asset_Id(fk) ... |
71. when to use generator class="assigned" vs 'native' forum.hibernate.orgHi All, I auto-generated by Hibernate mapping files from an existing MySQL schema. Each of the mapping files specifies the id as: |
72. Could not fetch initial value for increment generator forum.hibernate.orgSEVERE: Table 'test.MESSAGES' doesn't exist -> Could not fetch initial value for increment generator Hi, I'm working on a very simple 'HelloWorld' program. I have a mySQL db running on localhost. Below I printed my HelloWorld.java, Message.hbm.xml and the log/error messages. I'm stuck on this problem for a couple of days now so I hope somebody can get me in the ... |
73. the select generator forum.hibernate.org |
74. Problem to using generator class native.. forum.hibernate.orgHello Sir, I have Oracle database,It's properly configured with hibernate. I am facing problem to generate primary key using generator class native.when this code executes it always tried to save null in column:id .although this column already set as primary in database.I mean to say key is generating as the native property says. Please any one suggest what wrong i have ... |
75. Code generator not finding table and column comments forum.hibernate.orgI am using hibernate tools eclipse plugin to generate pojo's based on an oracle 10i schema. Everything is working well using a custom reverse engineering strategy. The problem I am currently having is that I am not able to find any table or column comments in the "Table" object. I am using the "ismanyToManyTable" hack to find the currentTable, I then ... |
76. specifiy initial value of id generator forum.hibernate.orgHi, I use the following in the class hbm.xml. I would like the index of the mysql table starting from 0 instead of 1. But the following does not set the initial value to be 0. Please help. |
77. DB2 insert error with generator=identity forum.hibernate.orgpublic class GroupD { private Integer Gruppe_ID; private String Gruppe_Name; public GroupD(String Gruppe_Name) { this.Gruppe_Name = Gruppe_Name; } public String toString(){ ... |
78. Multiple generators for one table forum.hibernate.orgHi all, I need to add an auto increment(sequence) or random number column to a table, which already has defined id generator to some other column of the same table already. With out going thru an Oracle db sequence, can i achieve that thru Hibernate? Can i have more than one generator for the same table? I need to add a ... |
79. issue while using |
80. Id generator for Invoice numbers (same length) forum.hibernate.orgHello, we have an Invoice table, and want id to be the same length like: 00001 00002 00003 .... What is the Id generator for this purpose? If We need to implement our own Id Generator, please would please give us some ideas. Currently we use Long type for id. can id be string type? Thanks. Dave |
81. Implementing a custom unique random identity generator forum.hibernate.orgGreetings, All my data tables in my database have a BIGINT field named "id" as their pk. NONE of them use the AUTO_INCREMENT feature - instead I have a table named Used_Random_Longs consisting of fields: --- random_long BIGINT(12) unsigned PRIMARY KEY, --- used_in_table varchar(30) Inserting a row into a data table consists of: a--using a stored procedure to generate random BIGINTs ... |
82. Using pooled-lo generator without annotation in JPA forum.hibernate.org |
83. SET GENERATOR VALUE forum.hibernate.org |
84. Different Generator for Each Subclass in Inheritance forum.hibernate.orgAm using "Table per concrete class with unions" hibernate mapping strategy. Each child is saved in a different table and the ids have to start from 1 sequentially. Is there a way for each the children to have different generators? The mapping file:- Code: |
85. Allocation size for AUTO generator forum.hibernate.orgThe default allocation sizes for @GeneratedValue(strategy=GenerationType.SEQUENCE) and @GeneratedValue(strategy=GenerationType.TABLE) is 50. Unfortunately if I let Hibernate choose the best generator according to the database dialect (i.e. @GeneratedValue(strategy=GenerationType.AUTO) Hibernate uses an allocation size of 1, which ruins performance. Is there a way to specify the default allocation size for AUTO? Or is this a bug? Btw.: I'm using Hibernate 3.5.6-Final (core + entitymanager). ... |
86. Migrating increment generator to MySQL identity forum.hibernate.orgDear all, I'm faced with an application that uses Hibernate 3.2.0.ga with increment generator that I need to interface with. The preferred interface mechanism is to write data directly to the database that is managed by Hibernate. Alas the increment generator poses issues as it cannot be accessed or controlled from outside of Hibernate. I have tried to change it to ... |
87. Metamodel Generator doesn't work in 2 modules forum.hibernate.orgWhen entities are in more than one module. For instance I have abstract base entity class let's say: "AbstractEntity" in module A and other entities extending this base entity class both in module B. When I build module B by maven than generator doesn't create metamodel for AbstractEntity_ and metamodel in modules B doesn't extend the AbstractEntity_. It seems that the ... |
88. Generator class to use with DB trigger forum.hibernate.orgHI, I have a audit table in my application in which couple of columns are assigned value generated from the DB sequence. one is ID column and other is the audit number. We are planning to use DB trigger for these 2 columns. I could'n find a suitable generator class for this. Please suggest. Thanks Sandeep |
89. Using Generators for Properties forum.hibernate.orgHi All, In the legacy DB there is a table called "Counter" which tells the next possible value of a business column (not identity). I have created a view on this table and implemented the org.hibernate.id.TableHiLoGenerator for this ID column. Now I have a scenario to use this "Counter" table for a property (which is not the primary key of that ... |
90. generator of code forum.hibernate.orgUP after installation Hibernate 3 I generates code hibernate 2 hibernate.cfg.xml Code: |
91. On-demand generator in hibernate forum.hibernate.orgI hope this is not a old question. I am writing a code where I need to get the next value from Oracle Sequence. One way to do it from Hibernate is using SQLQuery select Seq.nexval from dual. The problem is it doesnt work on all DBs. (We use HSQL for Junit testing and it fails badly) Another way is to ... |
92. Transfer entities between to database. Id generator problem. forum.hibernate.orgBonjour, I have DBF database. I have Hibernate database model with xml-files of mapping, with identity generators. And now i need to transfer data from dbf-table using Hibernate. But the problem is that I don't need auto-generated ID's. they should be the same as in DBF records. I think about 2 solutions: 1. Create complex id-generator, that can generate id or ... |
93. [Res.] JPA Metamodel Generator 1.1.0.Final ClassFormatError forum.hibernate.orgNewbie Joined: Thu Mar 31, 2011 4:56 am Posts: 3 Hi ! I'm using Hibernate JPA Metamodel Generator 1.1.0.Final and it works perfectly on my computer with maven 3.0.3. But when I try to build the same project on 2 other computers with the same version of maven it fails with the folowing error : Code: An annotation processor threw an ... |
94. Id Generator creating changes on unchanged objects forum.hibernate.orgNewbie Joined: Tue Feb 01, 2011 11:06 am Posts: 3 Hello, now its the real problem I'm facing and not some kind of symptom. I've got the following model with hibernate annotations, a customer with a shippingAddress, both have a version: Code: @Entity @Table(name = "CUST_CUSTOMER") @Inheritance(strategy = InheritanceType.JOINED) public class Customer implements DomainEntity, CreationTimestampAware, UpdateTimestampAware { ... |
95. this id generator generates long, integer, short or string forum.hibernate.orghey, i'm having a problem when i try to save on my table, because i can't insert the ID which is a BigDecimale on the Hibernate mapping file. i want to add BigDecimale to allowed types, or just set big_decimal fields to be considered as long in my hibernate generation file, any help will be very appreciated. My Regards |
96. how to disable generator when db trigger creates id forum.hibernate.org |
97. Xdoclet @hibernate.generator-param bug ? forum.hibernate.org |
98. generator class="identity" not working in DB2 forum.hibernate.orgNewbie Joined: Wed Aug 10, 2011 8:47 pm Posts: 1 -------------------------------------------------------------------------------------------------------------- PricingPlanHistory.hbm.xml |
99. Use Native Id Generator as part of own custom Id Generator forum.hibernate.orgHello I have an interesting question, I need to write my own id generator, because I want to use Custom-types for my Id. For my own generator I would like to use the native id generator to set one of the properties of the actual ID (as wrapper) Is it possible to use the native generator in my custom generator? regards ... |
100. Wrong DDL with new generators and AUTO strategy ? forum.hibernate.org |