Generator 1 « Map « JPA Q&A





1. Hibernate ID Generator    stackoverflow.com

Anyone know of some good tutorials on how to create a custom ID generator for hibernate?

2. Hibernate When is it best to use what?    stackoverflow.com

I am relatively new with Hibernate. I used Persistence and Toplink prior to this but didn't help too much when learning Hib. When I define my entity classes, specifically the id ...

3. The equivalent of using MySQL and Hibernate3 annotations    stackoverflow.com

Starting a new project I'd like to use Hibernate annotations with MySQL instead of the configuration files I've used so far. And I can't seem to find the equivalent of:

 <id name="id" ...

4. How to define reusable elements in hibernate mapping    stackoverflow.com

I have a Hibernate hbm.xml mapping file which defines a large number of class mappings. Each of these needs an <id> definition and a corresponding <generator> definition. In this particular application, ...

5. Hibernate with Oracle 11g not working with "select" generator    stackoverflow.com

I 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.com

I 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.com

I 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.com

As I am using using mysql database and I am using id strategy.

@GeneratedValue(strategy = GenerationType.TABLE
and I found that using jpa xml can define a application level generator from ...

9. Random ID Generator, mapping vs. same-column    stackoverflow.com

There'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.com

I'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.com

I 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.com

My hbm2hbmxml task is generating ids such as below

    <id name="id" type="long">
        <column name="id" />
       ...

13. Java - JPA - Generators - @SequenceGenerator    stackoverflow.com

I am learning JPA and have confusion in the @SequenceGenerator annotation. Upto my understanding, it automatically assigns a value to numeric identity fields/properties of an entity. Q1. Does this sequence generator make use ...

14. JPA/JDO entity to XML XSD generator    stackoverflow.com

I 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.com

is 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.com

I'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.com

What 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.com

My PostgreSQL tables have id's of type bigserial, meaning they are generated at the time rows are inserted (and thus, the id column's value is not supplied in the INSERT statement). ...

19. Hibernate exception while using "identity" generator - how to use    stackoverflow.com

I 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.com

I have jpa annotated entity class like:

@Configurable
@Entity
@Table(name="PLAYERS")
public class Player
{
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="ID")
    private Integer id;
   ...

21. Hibernate confusion    stackoverflow.com

I have read several tutorial concerning the for hibernate. I'm still getting confusion. Does the generator changes in case of associations. Can someone explain well according to their experience ...

22. Eclipse complying "Unresolved generator name" but all works fine    stackoverflow.com

I 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.com

I 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.

<id name="pk1" type="java.math.BigInteger">
  ...

24. Assigned Generator Class on Hibernate Annotations    stackoverflow.com

Hibernate 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 in Hibernate mapping?    stackoverflow.com

<id name="message_id" column="message_id">
   <generator class="native"/>
</id>
Above typical example of using generator for ID column, I need auto-generating column in my project but not ID.

26. Hibernate ID generator - Option for both set the id myself, or hibernate generate it    stackoverflow.com

Is 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.com

I 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.com

I have two classes in a hibernate mapping like this:

<hibernate-mapping>
    <class name="ForecastMethod" table="ForecastMethod">
        <id name="code" type="java.lang.Long">
      ...

29. Problem with hibernate trigger-generated ids (MySQL)    stackoverflow.com

I'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.com

I 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.com

I 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.com

Asking 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.com

Currently 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.com

I'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:

session ...

35. Hibernate assigned generator    stackoverflow.com

The 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.com

What is the basic difference between when we use native and increment types id generator in hibernate. As i was having a entity, in which the generator was previuosly native, but ...

37. how does hibernate generator increment handle deletes    stackoverflow.com

This is how i am using the generator:

    <id name="id" column="column_name">
        <generator class="increment"/>
    </id>

private Integer id;
The behaviour that ...

38. hibernate generator increment confict with table auto increment    stackoverflow.com

I 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.com

I 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.com

I 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.com

I 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.com

When 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.com

My Hibernate hbm file looks something like this with a mysql DB:

<hibernate-mapping>
<class name="com.company.common.bo.position.Parent" table="Parents"
    abstract="true">
    <id name="id">
        <generator ...

44. Hibernate gain access to identifier generator object    stackoverflow.com

I 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.com

Are 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.com

I am using

@TableGenerator(name="tab",initialValue=2,allocationSize=50)
on Entities and define the ID with
@Id
@GeneratedValue(generator="tab",strategy=GenerationType.TABLE)
private int id;
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.com

I 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.com

i am using the following hibernate mapping file

<class name="com.abdus.hibernate.UserTable" table="tbl_users">
    <meta attribute="class-description">
        This class contains the user details.
    ...

50. [Hibernate] Please explain hilo generator    coderanch.com

I 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.com

I 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.(SessionFactoryImpl.java:178) at org.hibernate.cfg.Configuration.buildSessionFactory

52. My hibernate generator    coderanch.com

I 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.com

Hi 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.com

Hi! 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.com

Hi, 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. The attribute in the oracle db is defined ...

56. Unknown Id.generator Hibernate exception    coderanch.com

I 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.com

Hi, I have my persistance.xml and orm.xml in META-INF folder and both are in classpath in war. persistance.xml -------------------------------- /META-INF/orm.xml User I have my mapped class files here I have my DB properties here. orm.xml ------------------- I have more sequence generators here. I have named queries here. finally ...

58. JPA/Hibernate Generator issues...    coderanch.com

I'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.com

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 on the capabilities of the underlying database. It also says to use this when we want to keep our mapping metadata portable. Q. - ...

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.com

Hi, 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.(AbstractEntityPersister.java:644) at net.sf.hibernate.persister.EntityPersister.(EntityPersister.java:690) at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:42) at net.sf.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:137) at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:805) at com.rm.juno.chequepayments.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:50) at com.rm.juno.chequepayments.server.dao.ChequePaymentsHibernateDAO.fetchTransactionListForChqPrinting(ChequePaymentsHibernateDAO.java:334) at com.rm.juno.chequepayments.server.br.ChequePaymentsBaseBR.fetchTransactionListForChqPrinting(ChequePaymentsBaseBR.java:1063) ...

67. Generator Select issue    forum.hibernate.org

Hi, 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 - fileName in DB ELEARNING_FILES_SID is Integer and FILE_NAME is ...

68. [SOLVED]hibernate.AnnotationException: Unknown Id.generator    forum.hibernate.org

Hi! 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 INFO: Hibernate Annotations 3.3.1.GA 03/10/2009 00:11:42 org.hibernate.cfg.Environment INFO: Hibernate 3.2.5 03/10/2009 00:11:42 org.hibernate.cfg.Environment INFO: hibernate.properties not found 03/10/2009 00:11:42 org.hibernate.cfg.Environment buildBytecodeProvider INFO: Bytecode provider name : cglib ...

69. How to assign PK manually when generator specified?    forum.hibernate.org

Hi 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.org

Hi 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.org

Hi All, I auto-generated by Hibernate mapping files from an existing MySQL schema. Each of the mapping files specifies the id as: . My code works best when I use the 'native' generator however to match the fact that MySQL auto generates a new id when a new row is inserted. So my question is when would you use assigned ...

72. Could not fetch initial value for increment generator    forum.hibernate.org

SEVERE: 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.org

Hello 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.org

I 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.org

Hi, 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. 0 Thanks a lot

77. DB2 insert error with generator=identity    forum.hibernate.org

public 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.org

Hi 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 for both MySQL and Oracle    forum.hibernate.org

Hi All, i have an issue while using the generator class sequence. In mysql defined as auto increment and in Oracle defined as Sequences. Both dialects we are using simultaneously. please suggest me the common approach for both. DAILY_SEQ . i have to use mysql and Oracle Db's. while using Mysql, getting the below error. Error@HibernateUtil startup ...

80. Id generator for Invoice numbers (same length)    forum.hibernate.org

Hello, 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.org

Greetings, 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 ...

83. SET GENERATOR VALUE    forum.hibernate.org

84. Different Generator for Each Subclass in Inheritance    forum.hibernate.org

Am 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.org

The 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.org

Dear 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.org

When 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.org

HI, 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.org

Hi 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.org

UP after installation Hibernate 3 I generates code hibernate 2 hibernate.cfg.xml Code: jdbc:mysql://localhost/hibernate ...

91. On-demand generator in hibernate    forum.hibernate.org

I 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.org

Bonjour, 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.org

Newbie 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.org

Newbie 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.org

hey, 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

97. Xdoclet @hibernate.generator-param bug ?    forum.hibernate.org

98. generator class="identity" not working in DB2    forum.hibernate.org

Newbie 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.org

Hello 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