xx.hbm.xml
<class table="T_TPXW" name="TTpxw" lazy="true"..>
<id name="CBH" column="C_BH" type="string" unsaved-value="null">
<generator class="uuid.hex"/>
</id>
<list name="TTpxwTps" table="T_TPXW_TP" inverse="false" lazy="true" batch-size="10" cascade="all-delete-orphan">
<key column="C_BH" not-null="true" />
<list-index column="N_XH"/>
<composite-element class="TTpxwTp" >
<property column="C_BT" name="CBT" .....
</composite-element>
</list>
</class>
If I try something like that:
TTpxw tpxw = (TTpxw)new session.load(TTpxw.class, "2c9090a00b47a5b9010b47a6d9540001");
List list = s.createFilter(tpxw.getTTpxwTps(), "").setFirstResult(1).setMaxResults(10).list();
then
Hibernate: select ttpxw0_.C_BH as C1_33_0_, ttpxw0_.C_XWBT as C2_33_0_, ttpxw0_.C_XWBT1 as C3_33_0_, ttpxw0_.T_XWNR as T4_33_0_, ttpxw0_.D_FBRQ as D5_33_0_, ttpxw0_.N_FBRDM as N6_33_0_, ttpxw0_.N_DJS as N7_33_0_, ttpxw0_.C_XWLY as C8_33_0_, ttpxw0_.N_TPZS as N9_33_0_, ttpxw0_.N_TPXSFS as N10_33_0_, ttpxw0_.N_TPHS as N11_33_0_ from T_TPXW ttpxw0_ where ttpxw0_.C_BH=?
org.hibernate.QueryException: collection of values in filter: this []
at org.hibernate.hql.ast.HqlSqlWalker.prepareFromClauseInputTree(HqlSqlWalker.java:204)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:672)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:227)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:159)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:127)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:83)
at org.hibernate.engine.query.FilterQueryPlan.<init>(FilterQueryPlan.java:24)
at org.hibernate.engine.query.QueryPlanCache.getFilterQueryPlan(QueryPlanCache.java:93)
at org.hibernate.impl.SessionImpl.getFilterQueryPlan(SessionImpl.java:1437)
at org.hibernate.impl.SessionImpl.createFilter(SessionImpl.java:1240)
Anyone can help me?
|