Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.0
Mapping documents:
1- Categoria
<hibernate-mapping default-lazy="false">
<class name="com.coginfo.kf.bean.Categoria" table="KFT_CATEGORIA" select-before-update="true">
<id name="codint" type="long" unsaved-value="0">
<generator class="sequence">
<param name="sequence">KF_SEQ_CATEGORIA</param>
</generator>
</id>
<property name="cafdsc" type="string">
<column name="cafdsc" length="1000" sql-type="string" not-null="true"/>
</property>
<set name="categoriaAclAmministratori" where="stsacl = '1'">
<key column="codintctg"/>
<one-to-many class="com.coginfo.kf.bean.CategoriaAcl"/>
</set>
</class>
</hibernate-mapping>
-KFT_CATEGORIA_ACL
<hibernate-mapping default-lazy="false">
<class name="com.coginfo.kf.bean.CategoriaAcl" table="KFT_ACL_CATEGORIA" select-before-update="true">
<composite-id name="id" class="com.coginfo.kf.bean.CategoriaAclPk">
<key-many-to-one name="codintacl" class="com.coginfo.kf.bean.Acl"/>
<key-many-to-one name="codintctg" class="com.coginfo.kf.bean.Categoria"/>
<key-property name="stsacl"/>
</composite-id>
<discriminator column="stsacl" insert="false"/>
<subclass name="com.coginfo.kf.bean.CategoriaAclAdm" discriminator-value="1"/>
<subclass name="com.coginfo.kf.bean.CategoriaAclSvil" discriminator-value="2"/>
<subclass name="com.coginfo.kf.bean.CategoriaAclCol" discriminator-value="3"/>
</class>
</hibernate-mapping>
- ACL
is a simple map with id and property cafute
I must write with Criteria this sql:
select ca.* from kft_categoria c, kft_acl_categoria ca, kft_acl acl
where ca.codintctg = c.codint and ca.codintacl = acl.codint and acl.cafute = 'AV09901' and ca.stsacl = '1'
Can anyone help me plz?
thanks