Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@Table(name="FOO")
public class Bar{
@Column(name="MY_CUSTOM_NAME")
private String name;
}
/*
Table structure :
--------------------
| FOO |
--------------------
| MY_CUSTOM_NAME |
--------------------
*/
//With the JOOQ generator :
FooRecord foo = create.selectFrom(FOO)
.where(FOO.MY_CUSTOM_NAME.equal("We don't care"))
.fetchAny();
//With the JPA generator :
BarRecord bar = create.selectFrom(BAR)
.where(BAR.NAME.equal("We don't care")).fetchAny();
//Of course, we can use fetchInto(Bar.class) with both result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment