HashSet<String> usernames =
new HashSet<>(
QueryBuilder.select(UserField.username)
.where(UserField.firstName.eq(firstName))
.getResultList());
Due to the UserField.username the Querybuilder knows that the tabel is User, and the returntype String so it creates a query returning a string result stream, making it faster and easier than to extract it first out of a tuple.
Is now equal to:
ArticleField can be imported statically to remove boilerplate:
Also there is support for simple operations like:
Due to the UserField.username the Querybuilder knows that the tabel is User, and the returntype String so it creates a query returning a string result stream, making it faster and easier than to extract it first out of a tuple.