Hibernate version:
Maven dependencies:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.3.0.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.3.1.ga</version>
</dependency>
Name and version of the database you are using:
PostgreSQL 8.2/8.3
I am mapping a ManyToMany relationship in my app. Ideally, I want the mapping table to look like this:
Code:
CREATE TABLE map_vehicle_division
(
unique_id varchar(32) NOT NULL,
last_modified timestamp with time zone NOT NULL,
vehicle_unique_id varchar(32) NOT NULL,
division_unique_id varchar(32) NOT NULL
) ;
Looking at the docs and after testing, I haven't been able to have the unique_id for the mapping table. I am aware of using a unique primary key, but I am trying to avoid that. Is that possible?
More importantly Is it possible to set the value of last_modified when when the relationship is created? I can live without the unique_id if I have to but I want to set the last_modified field when a new record is created. What's the best way to do that?
Thanks,
L