Hi, In my User class, I have
Code:
@CollectionOfElements(fetch = FetchType.EAGER)
@JoinTable(name = "user_privilege")
protected Set<Privilege> privileges;
Privilege is an embeddable class
Code:
@Embeddable
public class Privilege {
@Enumerated(EnumType.STRING)
@Column(name="function", nullable = false)
protected Function function;
@Enumerated(EnumType.STRING)
@Column(name="access", nullable = false)
protected Access access;
...
}
The problem is that @Enumerated(EnumType.STRING) tags in Privilege seem ignored, and the ordinal values are stored:
Code:
CREATE TABLE `user_privilege` (
`user_id` bigint(20) NOT NULL,
`access` int(11) DEFAULT NULL,
`function` int(11) DEFAULT NULL,
KEY `FK45FBD628C91846B3` (`user_id`),
CONSTRAINT `FK45FBD628C91846B3` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
)
I am using hibernate-jpa-2.0-api-1.0.0.Final.jar and hibernate3.jar
Any help will be appreciated,
-ZJ