Skip to content

Instantly share code, notes, and snippets.

@maxammann
Last active December 10, 2015 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxammann/4349849 to your computer and use it in GitHub Desktop.
Save maxammann/4349849 to your computer and use it in GitHub Desktop.
@DatabaseTable(name = "table")
public class Person implements TableObject {
@DatabaseColumn(position = 1, databaseName = "id", id = true)
private int id;
private String name;
@DatabaseColumn(position = 3, databaseName = "age")
private int age;
public Person()
{
}
@DatabaseColumnSetter(position = 2, databaseName = "name")
public void setFormattedName(String name)
{
if (name != null) {
this.name = name.toUpperCase();
}
}
@DatabaseColumnGetter(databaseName = "name")
public String getFormattedName()
{
return name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment