Skip to content

Instantly share code, notes, and snippets.

@edalquist
Created February 7, 2012 15:10
Show Gist options
  • Save edalquist/1760141 to your computer and use it in GitHub Desktop.
Save edalquist/1760141 to your computer and use it in GitHub Desktop.
## Query using: criteria.add( Restrictions.naturalId().set( "ssn", "1234" ).set( "state", france ) );
select
this_.id as id0_1_,
this_.firstname as firstname0_1_,
this_.lastname as lastname0_1_,
this_.ssn as ssn0_1_,
this_.state_id as state5_0_1_,
state2_.id as id1_0_,
state2_.name as name1_0_
from Citizen this_
left outer join State state2_ on this_.state_id=state2_.id
where (this_.ssn=? and this_.state_id=?)
## Query using: criteria.add( Restrictions.naturalId().set( "ssn", "1234" ) );
select
this_.id as id0_1_,
this_.firstname as firstname0_1_,
this_.lastname as lastname0_1_,
this_.ssn as ssn0_1_,
this_.state_id as state5_0_1_,
state2_.id as id1_0_,
state2_.name as name1_0_
from Citizen this_
left outer join State state2_ on this_.state_id=state2_.id
where (this_.ssn=?)
## Query using: criteria.add( Restrictions.naturalId().set( "ssn", "1234" ).set( "lastname", france ) );
select
this_.id as id0_1_,
this_.firstname as firstname0_1_,
this_.lastname as lastname0_1_,
this_.ssn as ssn0_1_,
this_.state_id as state5_0_1_,
state2_.id as id1_0_,
state2_.name as name1_0_
from Citizen this_
left outer join State state2_ on this_.state_id=state2_.id
where (this_.ssn=? and this_.lastname=?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment