Issue Type: Bug Bug
Affects Versions: 3.6.9
Assignee: Unassigned
Components: core
Created: 13/Dec/12 8:23 AM
Description:

If an entity has a Java Map attribute (key-value) whose value type is non primitive (ie an Object other than String, Long, etc.), then in the auto-generated DDL there is an improper "unique" constraint on the value column of the association table corresponding to the Java Map.

Example (simplified) :

@Entity
public class Customer { @OneToMany @JoinTable(name="customer_order") @MapKeyColumn(name = "somekey", length = 10) private Map<String,Order> orders; }

In this example, the association table is "customer_order"; in the auto-generated DDL, the "customer_order" table has 3 columns (so far so good): customer_id, somekey, and order_id

Problem: there is an "unique" constraint on the order_id column.

If in the Java above example we replace the "Order" type by "String" (ie private Map<String,String> orders), then there is no unique constraint on the order column of the association table.

Environment: Hibernate 3.6.9, Ubuntu 10.10, PostgreSQL 8.4
Project: Hibernate ORM
Priority: Minor Minor
Reporter: Pierre Sion
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira