HHH-8712 - Hibernate startup error "HHH015011: Unable to locate static metamodel field"

This commit is contained in:
Steve Ebersole 2015-10-28 20:44:05 -05:00
parent 25d8a66ac7
commit dbb84be810
7 changed files with 109 additions and 1 deletions

View File

@ -23,7 +23,10 @@ public class FunkyExtendedEmbeddedIdTest extends BaseEntityManagerFunctionalTest
@Override
public Class[] getAnnotatedClasses() {
return new Class[] {
WorkOrderComponentId.class, WorkOrderComponent.class, WorkOrderId.class
WorkOrderId.class,
WorkOrder.class,
WorkOrderComponentId.class,
WorkOrderComponent.class
};
}

View File

@ -0,0 +1,24 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.jpa.test.metamodel.attributeInSuper;
import java.io.Serializable;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.EmbeddedId;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
@javax.persistence.Entity
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 */
}

View File

@ -7,6 +7,9 @@
package org.hibernate.jpa.test.metamodel.attributeInSuper;
import javax.persistence.EmbeddedId;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
/**
* @author Steve Ebersole
@ -15,4 +18,10 @@ import javax.persistence.EmbeddedId;
public class WorkOrderComponent {
@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;
}

View File

@ -0,0 +1,17 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.jpa.test.metamodel.attributeInSuper;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
@StaticMetamodel(WorkOrderComponentId.class)
public abstract class WorkOrderComponentId_ extends WorkOrderId_ {
public static volatile SingularAttribute<WorkOrderComponentId, Long> lineNumber;
}

View File

@ -0,0 +1,20 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.jpa.test.metamodel.attributeInSuper;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
/**
* @author Steve Ebersole
*/
@StaticMetamodel(WorkOrderComponent.class)
public class WorkOrderComponent_ {
public static volatile SingularAttribute<WorkOrderComponent, WorkOrderComponentId> id;
public static volatile SingularAttribute<WorkOrderComponent, WorkOrder> workOrder;
}

View File

@ -0,0 +1,16 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.jpa.test.metamodel.attributeInSuper;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
@StaticMetamodel(WorkOrderId.class)
public abstract class WorkOrderId_ {
public static volatile SingularAttribute<WorkOrderId, Long> plantId;
public static volatile SingularAttribute<WorkOrderId, String> workOrder;
}

View File

@ -0,0 +1,19 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.jpa.test.metamodel.attributeInSuper;
import java.util.Set;
import javax.persistence.metamodel.PluralAttribute;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
@StaticMetamodel(WorkOrder.class)
public class WorkOrder_ {
public static volatile SingularAttribute<WorkOrder, WorkOrderId> id;
public static volatile PluralAttribute<WorkOrder, Set, WorkOrderComponent> components;
}