spring.datasource.url=jdbc:postgresql://localhost:5432/mydatabase
spring.datasource.username=myusername
spring.datasource.password=mypassword
spring.datasource.driver-class-name=org.postgresql.Driver
import com.enklib.orm.annotations.*;
@Select("SELECT * FROM users WHERE age > :age")
public List<User> getUsersAboveAge(@Param("age") int age) {
// ...
}
import com.enklib.orm.annotations.*;
@Table("users")
public class User {
@Column("id")
private int id;
@Column("name")
private String name;
@Column("age")
private int age;
// ...
}
@Autowired
private MyDatabaseAccess myDatabaseAccess;
List<User> users = myDatabaseAccess.getUsersAboveAge(18);