-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
TRUNK-5830: Migrate FieldType from Hibernate Mapping XML to JPA annotations #4804
base: master
Are you sure you want to change the base?
Conversation
Can you start by fixing the merge conflicts? |
fixed the merge conflict |
@dkayiwa @wikumChamith I added the missing columns to Field type table |
@Audited | ||
@AttributeOverrides(value = { | ||
@AttributeOverride(name = "name", column = @Column(name = "name", length = 50, nullable = false)), | ||
@AttributeOverride(name = "retired", column = @Column(name = "retired", columnDefinition = "boolean default false")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use "boolean default false" here?'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should set the retired
column default value as false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In BaseOpenmrsMetadata default value for retired is set to false.
openmrs-core/api/src/main/java/org/openmrs/BaseOpenmrsMetadata.java
Lines 58 to 60 in 335c2b5
@Column(name = "retired", nullable = false) | |
@Field | |
private Boolean retired = Boolean.FALSE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without including columnDefinition = "boolean default false"
, HL7Service, OrderEntryIntergationTest,
and MedicationDispenseServiceTest
tests are getting failed.
Caused by: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: NULL not allowed for column "RETIRED"; SQL statement: insert into FIELD_TYPE (FIELD_TYPE_ID, NAME, IS_SET, CREATOR, DATE_CREATED, UUID) values (?, ?, ?, ?, ?, ?) [23502-200] at org.h2.message.DbException.getJdbcSQLException(DbException.java:459)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not like the column definition value of boolean default false
Can we think of an alternative?
Description of what I changed
Issue I worked on
see https://issues.openmrs.org/browse/TRUNK-5830
Checklist: I completed these to help reviewers :)
My IDE is configured to follow the code style of this project.
No? Unsure? -> configure your IDE, format the code and add the changes with
git add . && git commit --amend
I have added tests to cover my changes. (If you refactored
existing code that was well tested you do not have to add tests)
No? -> write tests and add them to this commit
git add . && git commit --amend
I ran
mvn clean package
right before creating this pull request andadded all formatting changes to my commit.
No? -> execute above command
All new and existing tests passed.
No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.
My pull request is based on the latest changes of the master branch.
No? Unsure? -> execute command
git pull --rebase upstream master