Storm Object Relational Mapping
| src | 6 years ago | ||
| .gitignore | 6 years ago | ||
| README.md | 6 years ago | ||
| pom.xml | 6 years ago | ||
Context
[
{
"name" : "H2",
"driver" : "org.h2.Driver",
"url" : "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1",
"username" : "",
"password" : ""
}
]
Interface
@Database(context = "H2")
private interface UserRepository {
@Select(sql = "select * from users")
public List<User> fetchAll();
@Delete(sql = "delete from users where id = ?")
public int delete(int id);
}
Use
UserRepository repository = StormRepository.newInstance(UserRepository.class);
List<User> users = repository.fetchAll();
Mapping
@ColumnProperty(name = "employee_id")
private int employeeID;