A library to work with Hibernate by fluent API. This library hasn't dependencies, except Hibernate libraries. It requires Java 1.6 and above. Now it can be used with Hibernate 5 only. To use the library with Hibernate 4, it should be rebuilt, using Hibernate 4 as a dependency.
<dependency>
<groupId>com.github.v-ladynev</groupId>
<artifactId>fluent-hibernate-core</artifactId>
<version>0.1.4</version>
</dependency>
'com.github.v-ladynev:fluent-hibernate-core:0.1.4'
Get all users
List<User> users = H.<User> request(User.class).list();
Getting a user with a login my_login
final String loginToFind = "my_login";
User user = H.<User> request(User.class).eq("login", loginToFind).first();
Get all users, but only with login
and id
properties are filled (other properties will be null).
List<User> users = H.<User> request(User.class).proj("login").proj("id")
.transform(User.class).list();
- A console project with a lot of query examples
- A console project using Spring to configure fluent-hibernate
- A simply console Eclipse project. This project uses Hibernate 5 and MySQL. It has a very simply Eclipse structure (without Gradle stuff).