Skip to content

Various new features added#7

Open
sproket wants to merge 1 commit into
r5v9:masterfrom
sproket:master
Open

Various new features added#7
sproket wants to merge 1 commit into
r5v9:masterfrom
sproket:master

Conversation

@sproket
Copy link
Copy Markdown

@sproket sproket commented Aug 27, 2011

  • Added support for the "is" prefix for Boolean properties
  • Added Field level Annotation support for Column and NoColumn annotations.
  • Improved the DefaultNameGuesser to handle situations like:
    Class Category -> Table Categories
    Class Supply -> Table Supplies
    etc...
  • Added support for Enum properties
    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.

  • Changed it so that UPDATE statements can be smarter in that they will only update changed fields.

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.

  • Added executeSQL methods to allow arbitrary SQL statements to be executed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant