auto « Field « JPA Q&A





1. hibernate - another auto generated field which is not the ID    stackoverflow.com

I want to create another autogenerated field in my class.
I followed this unanswered question - with no success Generate an auto generated value of a field under Java Hibernate ...

2. [JPA] How to auto-inc a filed in ClassA based on value of a field in classB?    coderanch.com

Hi Sorry if my title is not enough expressive. I have an entity class named Brocj and it has a field named row. I have another object named Cont with a field named contNum. Bocj and Cont have a one-to-many relation with eachother. The row field should act as a counter for Brocj entity stored for a particular Cont entity. The ...

4. Auto-update of createdby and modifiedby fields    forum.hibernate.org

In almost all my classes, I have two fields called "created by" and "modified by" that store, not suprisingly, the User object that is responsible for creating the object in the first place, and the user that last modified the object. My question is this: What approach should I take so that these fields get updated on cascading save/update/delete actions? I ...

5. auto generate a property field    forum.hibernate.org

how can i make a mapping property (lpos) to become incremental by not using id because i already have an id that is assigned but i need another property to be incremental. making lpos an id will throw an duplicate id constraint error. is there a way to put a generator for a property mapping? this existing can save my data ...

6. Auto incrementing a field?    forum.hibernate.org