-
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
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8d07f67
TRUNK-6280: Migrate GlobalProperty from Hibernate Mapping XML to JPA …
ManojLL bfab6da
TRUNK-6280: added @Lob annotation
ManojLL 89f02ec
TRUNK-6280: Remove length attribute from text data type
ManojLL ca9d662
TRUNK-6280: Remove length attribute from dateChange property
ManojLL 0211b2b
TRUNK-6289: change description column to varchar(1024)
ManojLL 9dada87
TRUNK-6289: change description column to varchar(1024)
ManojLL 56d30d6
TRUNK-6280: removed liquibase changeset
ManojLL 63c4114
Merge branch 'master' into TRUNK-6280
ManojLL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,48 +12,83 @@ | |
import java.util.Date; | ||
|
||
import org.codehaus.jackson.annotate.JsonIgnore; | ||
import org.hibernate.annotations.Cache; | ||
import org.hibernate.annotations.CacheConcurrencyStrategy; | ||
import org.hibernate.envers.Audited; | ||
import org.openmrs.customdatatype.CustomDatatype; | ||
import org.openmrs.customdatatype.CustomDatatypeUtil; | ||
import org.openmrs.customdatatype.CustomValueDescriptor; | ||
import org.openmrs.customdatatype.SingleCustomValue; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.Id; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.Lob; | ||
import javax.persistence.ManyToOne; | ||
import javax.persistence.Table; | ||
import javax.persistence.Transient; | ||
|
||
/** | ||
* Global properties are simple key-value pairs persisted in the database GPs can be thought of as | ||
* something similar to environment variables used in operating systems. | ||
*/ | ||
@Entity | ||
@Table(name = "global_property") | ||
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE) | ||
@Audited | ||
public class GlobalProperty extends BaseOpenmrsObject implements CustomValueDescriptor, SingleCustomValue<GlobalProperty> { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@Id | ||
@Column(name = "property", nullable = false, length = 255) | ||
private String property = ""; | ||
|
||
@Column(name = "property_value", columnDefinition = "TEXT") | ||
@Lob | ||
private String propertyValue = ""; | ||
|
||
private transient Object typedValue; | ||
|
||
// if true, indicates that setValue has been called, and we need to invoke CustomDatatype's save | ||
@Transient | ||
private boolean dirty = false; | ||
|
||
@Column(name = "description", length = 1024) | ||
private String description = ""; | ||
|
||
@Column(name = "datatype", length = 255) | ||
private String datatypeClassname; | ||
|
||
@Column(name = "datatype_config", columnDefinition = "TEXT") | ||
@Lob | ||
private String datatypeConfig; | ||
|
||
@Column(name = "preferred_handler", length = 255) | ||
private String preferredHandlerClassname; | ||
|
||
@Column(name = "handler_config", columnDefinition = "TEXT") | ||
@Lob | ||
private String handlerConfig; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "changed_by") | ||
private User changedBy; | ||
|
||
@Column(name = "date_changed") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Date dateChanged; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "view_privilege") | ||
private Privilege viewPrivilege; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "edit_privilege") | ||
private Privilege editPrivilege; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "delete_privilege") | ||
private Privilege deletePrivilege; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 0 additions & 54 deletions
54
api/src/main/resources/org/openmrs/api/db/hibernate/GlobalProperty.hbm.xml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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