Wiki Blog Gallery

Connected with hibernate

Hibernate questions answered

  • UserType example of mapping Enum to int is here, Enum to string is here. Hibernate standard class is in hibernate-annotations. Sample of usage:

    hibernate-mapping

    <hibernate-mapping>
        <class name="Relationship" table="relationships">
            <list name="semanticTypes" table="semantic_types" fetch="select" lazy="false">
                <key column="parentId"/>
                <list-index column="ind"/>
     
                <element column="semanticType">
                    <type name="org.hibernate.type.EnumType">
                        <param name="enumClass">org.mycompany.dao.SemanticType</param>
                    </type>
                </element>
            </list>
        </class>
    </hibernate-mapping>
  • Loading of lazy entities can be done via org.hibernate.Hibernate#initialize(Object)

 
software/hibernate.txt · Последние изменения: 2008/03/08 23:46 dmitry
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki