Hi All,
I've followed the example at https://community.jboss.org/wiki/Java5EnumUserType and have Enum types working great in @ManyToOne relationships. For example:
@Column(name = "VisaStatusId") @Type(type = "com.starpoint.instihire.domain.hibernate.types.GenericEnumUserType", parameters = { @org.hibernate.annotations.Parameter(name = "enumClass", value = "com.starpoint.instihire.domain.jacket.VisaStatus") }) public VisaStatus getVisaStatus() { return visaStatus; }
Works great.
Now I'm trying to map a ManyToMany and no matter what I try I get some form of error saying that the target class is not mapped.
I'm trying to remove the table PositionType and replace it with an enum. Working with a table this mapping works fine:
@ManyToMany() @JoinTable(name = "JacketToPositionType", joinColumns = @JoinColumn(name = "JacketId"), inverseJoinColumns = @JoinColumn(name = "PositionTypeId")) public Set<PositionType> getPositionTypes() { return positionTypes; }
When I try to add the @Type annotation I always get
Caused by: org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: com.starpoint.instihire.domain.jacket.Jacket.positionTypes[com.starpoint.instihire.domain.jacket.PositionType]
Is what I'm trying to do possible? Or should I stick with the working tables?
Thanks Tony
|