-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: migrate hbm.xml to orm.xml #17821
base: master
Are you sure you want to change the base?
Conversation
return List.of(); | ||
} | ||
|
||
class DhisPersistenceUnitManager implements PersistenceUnitManager { |
Check notice
Code scanning / CodeQL
Unused classes and interfaces Note
return List.of(); | ||
} | ||
|
||
class DhisPersistenceUnitManager implements PersistenceUnitManager { |
Check notice
Code scanning / CodeQL
Inner class could be static Note
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
if (attribute == null) { | ||
return null; | ||
} else { | ||
return encryptor.encrypt(attribute.toString()); |
Check notice
Code scanning / CodeQL
Useless toString on String Note
@@ -117,8 +125,8 @@ | |||
return parentOrganisationUnit; | |||
} | |||
|
|||
public void setParentOrganisationUnit(Boolean parentOrganisationUnit) { | |||
this.parentOrganisationUnit = parentOrganisationUnit; | |||
public void setOrganisationUnit(boolean organisationUnit) { |
Check notice
Code scanning / CodeQL
Confusing overloading of methods Note
setOrganisationUnit
this.reportingPeriod = reportingPeriod; | ||
} | ||
|
||
public void setGrandParentOrganisationUnit(boolean grandParentOrganisationUnit) { |
Check notice
Code scanning / CodeQL
Confusing overloading of methods Note
As hibernate legacy
hbm.xml
mapping has been deprecated for 6.x. We have options to use annotation or jpa orm.xml mapping. After discussed, we decided to use the JPAorm.xml
mapping as it helps to avoid modifying all the Java Object Model classes and the object hierarchy.This PR transforms all hibernate
hbm.xml
files to JPAorm.xml
files which is based on JPA xsd schema http://xmlns.jcp.org/xml/ns/persistence/orm version = 2.2. It also adds JPA configuration for supporting this type of mapping.This is the final preparation step for upgrading to Hibernate 6.x
Changes note
HibernateMessageConversationStore
.Mapping refactor samples
Many-to-many
hbm.xml
orm.xml
Todo
UserType
by JPAAttributeConverter
which is used for mapping JsonB column.<component>
mapping which is not supported by JPA orm mapping.Notes
<generator class="native" />
<generated-value strategy="AUTO"/>
fetch=[select, subselect, join, batch]
lazy=false
fetch=EAGER
The default fetch-type are:
- ManyToOne: EAGER
- OneToMany: LAZY
- ManyToMany: LAZY
- OneToOne: EAGER