-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: hibernate-3.6.4 @ManyToMany with UserType target
PostPosted: Mon Apr 21, 2014 1:17 pm 
Newbie

Joined: Mon Feb 06, 2012 12:31 pm
Posts: 3
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.