1

複数のアクセス許可 (ENUM) を保持する Role オブジェクトがあります。しかし、私はこのエラーが発生し続けます。

Use of @OneToMany or @ManyToMany targeting an unmapped class: objects.Role.permissions[enums.AgentPermission]

どう表現するのがベストなのか。

役割クラス:

@Entity
@Table(name="\"Role\"")
public class Role {
    @Id
    @GeneratedValue
    private int id;
    @ManyToOne
    private Company company;
    private String name;
    @ManyToMany
    private Set<AgentPermission> permissions;
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
    ....
}

hibernate.cfg.xml

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
    <session-factory>
        <!-- hibernate dialect -->
        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
....    
        <mapping class="objects.Role" />
        <mapping class="objects.Tag" />
....    
    </session-factory>
</hibernate-configuration>
4

1 に答える 1