H2 1.4.191.
MySQL 5.7.11.
Hibernate: 5.1.0.Final.
All Spring modules: 4.2.5.RELEASE.
------------------------------

How I can fix this?
Next code gives me result with children:

getSessionFactory().getCurrentSession().createQuery(
            "from Category where categoryParentId = 
:parentId").setLong("parentId", 
parentId).list();//------------------------------------------------<class 
name="com.domain.Category" table="Category">
    <id name="id" type="long" access="property">
        <column name="categoryId" length="20"/>
        <generator class="identity"/>
    </id>
    <property name="name" column="categoryName" type="string"/>
    <property name="parentId" column="categoryParentId" type="long"/>
    <bag name="children" table="Category" inverse="true" lazy="true" 
fetch="select">
        <key>
            <column name="categoryParentId" not-null="true"/>
        </key>
        <one-to-many class="com.domain.models.Category"/>
    
</bag></class>//----------------------------...class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
    <property name="dataSource" ref="dataSource"/>
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.dialect">org.hibernate.dialect.H2Dialect</prop>
            <prop key="hibernate.show_sql">true</prop>
        </props>
    </property>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to