SAI Générique (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=63a1d8d...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNmMxZThjYjU1...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16607?atlOrigin=eyJpIjoiNmMxZT...
) HHH-16607 (
https://hibernate.atlassian.net/browse/HHH-16607?atlOrigin=eyJpIjoiNmMxZT...
) Hibernate bytecode enhancement makes private fields public (
https://hibernate.atlassian.net/browse/HHH-16607?atlOrigin=eyJpIjoiNmMxZT...
)
Issue Type: Bug Affects Versions: 6.2.2 Assignee: Unassigned Components:
bytecode-enhancement Created: 15/May/2023 07:17 AM Environment: - JDK17
- payara-embedded-all 6.2023.1
- Linux Debian Priority: Major Reporter: SAI Générique (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=63a1d8d...
)
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>
<!-- <
https://vladmihalcea.com/maven-gradle-hibernate-enhance-plugin/>
-->
<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 " );
}
(
https://hibernate.atlassian.net/browse/HHH-16607#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16607#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100225- sha1:a5851ae )