Hello, We are using the maven plugin for byte code enhancement with the following configuration:
<plugin>
<groupId>org.hibernate.orm.tooling</groupId>
<artifactId>hibernate-enhance-maven-plugin</artifactId>
<executions>
<execution>
<configuration>
-->
<failOnError>true</failOnError>
<enableDirtyTracking>true</enableDirtyTracking>
<enableLazyInitialization>false</enableLazyInitialization>
<enableAssociationManagement>false</enableAssociationManagement>
<enableExtendedEnhancement>false</enableExtendedEnhancement>
</configuration>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
</plugin>
All our entities have only private fields:
@Entity
@Table(name = "mytable")
public class MyTable {
@EmbeddedId
private IdTablePK mytablePK;
@Column(name = "LIBELL")
private String libell;
public MyTable(IdTablePK pk) {
this.mytablePK = pk;
}
public String getLibell() {
return libell;
}
public void setLibell(String libell) {
this.libell = libell;
}
}
After upgrading, the following check fails in our CI:
for(Field field : entity.getDeclaredFields()) {
int modifiers = field.getModifiers();
boolean isPrivate = (modifiers & Modifier.PRIVATE)!=0;
assertTrue(isPrivate, "The field must be private");
}
|