• Post Reply Bookmark Topic Watch Topic
  • New Topic

Criteria failed with oracle  RSS feed

avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i move from mysql to oracle.

I have the following code that return an entity in mysql and return null (no exceptions in the log) in the oracle.

DetachedCriteria dc = DetachedCriteria.forClass(Device.class).setFetchMode("setup", FetchMode.JOIN).add(Restrictions.eq("ormID", id));

List<ManagedElement> result = dc.getExecutableCriteria((Session)getEntityManager().getDelegate()).list();

if( !result.isEmpty() ) {
entry = result.get(0);

Device has onetoone relation with Setup.
Setup has relation to a lot of objects with OneToOne (which means that he also load them and they also load a lot of objects).

in mysql or if i remove the "setFetchMode("setup"," it works .

i look at the generated sql and i notice that it has a strange grammer:
select this_.id as id13_47_, this_.ormversion as ormversion13_47_...

also the sql was long and my editor has a problem to show the sql (i got "gibrish" in some parts).

Can you please give me a direction?

Thank you
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!