-
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-6280: Migrate GlobalProperty from Hibernate Mapping XML to JPA annotations #4805
base: master
Are you sure you want to change the base?
Conversation
private String propertyValue = ""; | ||
|
||
@Transient | ||
private transient Object typedValue; |
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.
Do we need transient
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.
@wikumChamith I updated the PR
private User changedBy; | ||
|
||
@Column(name = "date_changed") |
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.
Don't we have a length for this column in XML mapping?
private String property = ""; | ||
|
||
@Column(name = "property_value", columnDefinition = "TEXT", length = 65535) |
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.
Do we need to define a length with TEXT
?
Have you checked whether the audit table is generated correctly? It should have the same DDL as before. |
@ManojLL can you resolve the merge conflicts? |
global_property_AUD table is generated |
fixed the merge conflict |
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.
@dkayiwa can you take a look at this PR?
private boolean dirty = false; | ||
|
||
@Column(name = "description", columnDefinition = "TEXT") | ||
@Lob |
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.
Should this really be a LOB?
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.
if we do not use lob
, we are getting an error like : SchemaManagement Schema-validation: wrong column type encountered in column [description] in table [global_property]; found [clob (Types#CLOB)], but expecting [text (Types#VARCHAR)]
.
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.
@dkayiwa @wikumChamith I change the description column to VARCHAR(1024)
data type.
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.
@dkayiwa is this ready to merge?
Why are we modifying the database alongside this? |
we don't store lengthy text for descriptions, that is why I change description column type from |
That is correct. |
@@ -169,5 +169,13 @@ | |||
referencedTableName="obs" | |||
referencedColumnNames="obs_id"/> | |||
</changeSet> | |||
|
|||
<changeSet id="TRUNK-6280-2024-11-01" author="manojll"> | |||
<preConditions onFail="MARK_RAN"> |
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.
Let us try as much as we can to avoid mixing database changes with JPA annotations migration.
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.
@ManojLL let's create a separate ticket and a PR for this.
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.
@wikumChamith sure
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.
@dkayiwa @wikumChamith This is the PR for changing description type varchar : #4819
Description of what I changed
Issue I worked on
see https://issues.openmrs.org/browse/TRUNK-6280
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