1. 4 object heirarchy with where criteria on 4th object - HQL? forum.hibernate.orgWe have an object heirarchy that looks like this: Order - contains a set of... OrderItems - each OrderItem contains (has an association with) a... Unit - each Unit contains (has an association with) a... Product - Products have a property called... SKU The applicable sql tables/colums for this are: orders.OrderID orderitems.OrderID (fk to orders.OrderID) orderitems.Unit ID (fk to units.UnitID) units.UnitID ... |
2. criteria.add(example) / ... where {1=1} forum.hibernate.orgQuery By Example not working consistently (for me!). I am reverse engineering from DB schema. The first code-excerpt works but the second one doesn't work as I would expect. EXCERPT#1: Works Code: acc = new TAccount(); acc.setDeletedFg('N'); // this is a char in the generated DTO ... |
3. where restriction not propogating to isEmpty criteria expres forum.hibernate.orgCriteria criteria = getSession().createCriteria(Media.class); Disjunction or = Expression.disjunction(); or.add(Expression.isEmpty('producerRels')); // more experssions criteria.add(or); criteria.list(); |