Hibernate: insert into MyBaseObject (id) values (?)
Hibernate: insert into MyChildObject1 (id) values (?)
Hibernate: insert into MyBaseObject (id) values (?)
Hibernate: insert into MyChildObject2 (id) values (?)
Hibernate: select this_.id as id0_0_, case when this_1_.id is not null then 1 when this_2_.id is not null then 2 when this_.id is not null then 0 end as clazz_0_ from MyBaseObject this_ left outer join MyChildObject2 this_1_ on this_.id=this_1_.id left outer join MyChildObject1 this_2_ on this_.id=this_2_.id where case when this_1_.id is not null then 1 when this_2_.id is not null then 2 when this_.id is not null then 0 end=? and (this_.id=? or this_.id=?) limit ?