Hello all,
I'm currently facing with incorrect metamodel generation for following case:
My entities classes:
Code:
@MappedSuperclass
public class AbstractFoo {
@ManyToOne(cascade = CascadeType.MERGE, fetch = FetchType.LAZY, optional = true)
@JoinColumn(name = "DOO_ID", nullable = true)
protected Doo doo;
public int hashCode() {
//hashCode impl
}
public boolean equals(Object obj) {
//equals impl
}
//getters and settert
}
Code:
@Entity
@Table(name="Entity")
public class Entity extends AbstractFoo {
/**
* Primary key.
*/
@TableGenerator(name = "Emp_Gen", table = "ID_GEN", initialValue=10000, pkColumnName = "GEN_NAME", valueColumnName = "GEN_VAL")
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator = "Emp_Gen")
@Column(name = "ID")
protected Integer id;
//rest of properties with getters and setters
}
Maven metamodel plugin configuration:
Code:
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>1.3.5</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<outputDirectory>target/metamodel</outputDirectory>
<processors>
<processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
</processors>
</configuration>
</execution>
</executions>
</plugin>
I am expection following metamodel result:
Code:
@StaticMetamodel(AbstractTenantEntity.class)
public abstract class AbstractFoo_ {
public static volatile SingularAttribute<AbstractFoo, Doo> doo;
}
but actual result is
Code:
@StaticMetamodel(AbstractTenantEntity.class)
public abstract class AbstractFoo_ {
public static volatile SingularAttribute<AbstractFoo, Integer> hashCode;
}
What wrong with my code?
Thanks,
Toxa