|
Steve Ebersole, WorkOrder is an entity.
@Entity
@Tablename = "work_orders")
public class WorkOrder implements Serializable {
@EmbeddedId
private WorkOrderId id;
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, mappedBy = "workOrder")
@OrderBy("operation, bomItemNumber")
private Set<WorkOrderComponent> components;
/* other stuffs */
}
@Entity
@Table(name = "work_order_components")
public class WorkOrderComponent implements Serializable {
@EmbeddedId
private WorkOrderComponentId id;
@ManyToOne
@JoinColumns({
@JoinColumn(name = "WORK_ORDER", nullable = false, insertable = false, updatable = false),
@JoinColumn(name = "PLANT_ID", nullable = false, insertable = false, updatable = false)
})
private WorkOrder workOrder;
/* other stuffs */
}
The code you have within the test package mimics my domain classes perfectly.
I took the code from your org.hibernate.jpa.test.metamodel.attributeInSuper.FunkyExtendedEmbeddedIdTest and ran it inside my application and I get not-null values:
The application runs just fine during runtime and queries execute without problems.
The actual issue is the questionable error messages written to the log file during hibernate's boot sequence:
It seems anytime an @Embeddable class extends an @Embeddable that is also a @MappedSuperclass, this type of metamodel ERROR message is written to the application log at startup.
|