I have a pretty trivial example project with 3 entities and 4 tables where one of them have collection relationship of type 'Map <Entity, Basic>'... I don't use annotations but orm.xml... When I start this example I receive errors of kind:
org.hibernate.AnnotationException: No identifier specified for entity: my.missinglink.domain.ManagementCan some exeprienced kind person take a look at this, please ? If needed, I have mavenized micro project...
My entity is:
Code:
public class Management extends AbstractEnum {
protected Management () {
}
public Management (final long id, final String description) {
super(id, description);
}
}
public abstract class AbstractEnum extends AbstractEntity {
private String description;
protected AbstractEnum () {
}
public AbstractEnum (final long id, final String description) {
super(id);
this.description = description;
}
public String getDescription () {
return description;
}
public void setDescription (final String description) {
this.description = description;
}
}
public abstract class AbstractEntity implements Serializable {
private long id;
public long getId () {
return id;
}
protected AbstractEntity () {
id = 0;
}
public AbstractEntity (final long id) {
this.id = id;
}
@Override
public boolean equals (final Object object) {
if (object == null || !(object instanceof AbstractEntity))
return false;
return id == ((AbstractEntity) object).id;
}
@Override
public int hashCode () {
return (int) id;
}
}
My orm.xml is:
Code:
<persistence-unit-metadata>
<xml-mapping-metadata-complete />
<persistence-unit-defaults>
<access>FIELD</access>
</persistence-unit-defaults>
</persistence-unit-metadata>
<mapped-superclass class="my.missinglink.domain.AbstractEntity" />
<mapped-superclass class="my.missinglink.domain.AbstractEnum">
<attributes>
<basic name="description">
<column name="DESCRIPTION" />
</basic>
</attributes>
</mapped-superclass>
<entity class="my.missinglink.domain.Management">
<table name="MANAGEMENT" />
<attributes>
<id name="id">
<column name="ID_MANAGEMENT" />
</id>
</attributes>
</entity>