Skip to content

Instantly share code, notes, and snippets.

@christophe-dooapp
Created August 20, 2013 09:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christophe-dooapp/6279322 to your computer and use it in GitHub Desktop.
Save christophe-dooapp/6279322 to your computer and use it in GitHub Desktop.
@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