Various new features added#7
Open
sproket wants to merge 1 commit into
Open
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Class Category -> Table Categories
Class Supply -> Table Supplies
etc...
Example:
enum Gender {
Male, Female
}
class Patient {
private int id;
private String name;
private Gender gender;
// setters and getters etc...
}
Here you can read and write the Patient object with no issues. It stores as a String in the DB and converts back to an Enum when read back.
Following your pattern for simple elegance I avoided forcing bean classes to have extra code injected into them.
Instead I have a base class called PersistableObject and all I do is look to see if the bean is an instance of this class when the reading from the DB occurs. In that case I clone and store the bean state at that point. Later when a update is requested I do compares on the property values to decide which fields should appear in the update statement. If the bean class does not extend PersistableObject then it behaves in the usual default way.