|
|
|
When using inheritance for EmbeddedId classes, Hibernate generates meta model classes as follows:
{code} package com.setech.mrovelocityhub.persistence.maintenance.model;
import javax.annotation.Generated; import javax.persistence.metamodel.SingularAttribute; import javax.persistence.metamodel.StaticMetamodel;
@Generated(value = "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor") @StaticMetamodel(WorkOrderId.class) public abstract class WorkOrderId_ {
public static volatile SingularAttribute<WorkOrderId, Long> plantId; public static volatile SingularAttribute<WorkOrderId, String> workOrder;
} {code} {code} package com.setech.mrovelocityhub.persistence.maintenance.model;
import javax.annotation.Generated; import javax.persistence.metamodel.SingularAttribute; import javax.persistence.metamodel.StaticMetamodel;
@Generated(value = "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor") @StaticMetamodel(WorkOrderComponentId.class) public abstract class WorkOrderComponentId_ extends com.setech.mrovelocityhub.persistence.maintenance.model.WorkOrderId_ {
public static volatile SingularAttribute<WorkOrderComponentId, Long> lineNumber;
} {code}
The associated source java classes being used to generate the model are as follows:
{code} @Embeddable @MappedSuperclass public class WorkOrderId implements Serializable { private String workOrder; private Long plantId; /* other stuffs */ }
@Embeddable public class WorkOrderComponentId extends WorkOrderId { private Long lineNumber; /* other stuffs */ } {code}
The WorkOrder and WorkOrderComponent classes both reference their Id classes using @EmbeddedId annotation on the respective classes.
But during startup it writes the following to the log file: { quote noformat } 2013-11-05 08:40:50,028 ERROR [org.hibernate.ejb.metamodel.MetadataContext]: HHH015011: Unable to locate static metamodel field : com.setech.mrovelocityhub.persistence.maintenance.model.WorkOrderComponentId_#plantId 2013-11-05 08:40:50,028 ERROR [org.hibernate.ejb.metamodel.MetadataContext]: HHH015011: Unable to locate static metamodel field : com.setech.mrovelocityhub.persistence.maintenance.model.WorkOrderComponentId_#workOrder { quote noformat }
|
|
|
|