increment « Map « JPA Q&A

1. Hibernate auto-increment property

I know you can auto-increment an id by mapping;

<id column="user_id" name="id" >
<generator class="increment"/>
But is it also possible increment a property, what I tried so far didn't work;
<property column="numeric_value" name="nr" >
<generator class="increment"/>

2. Mapping inheritance with auto_increment id for child classes

Hibernate version: hibernate-3.2.0cr1 Mapping documents: Name and version of the database you are using: mysql-4.1.12 Hi. I have an inheritance configuration mapped as show above, ...

3. Mapping of non auto-increment ids (newbie)

Hi, I'm trying to map a class called User to a table of the same name whose primary key is an integer but is NOT auto-increment. The examples of mapping files I have seen propose the following kind of definition: But I suppose this only applies to auto-increment fields. What do I need to specify instead ...