These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Execution hangs on method size() of criteria.list()
PostPosted: Sun Oct 10, 2010 11:59 pm 
Newbie

Joined: Mon Mar 22, 2010 6:57 am
Posts: 6
Please help.

Code:
        Branch branch = branchDAO.read(40001);
        List byBranch = testBaseSpringHibernateDAOImpl._readAll("branch", branch);
        assertEquals("8. Entry branch match failed.", 1, byBranch.size());//hangs


Code:
    protected List<?> _readAll(String property, Object value) {
        Criteria criteria = getSession().createCriteria(getTargetClass());
        criteria.add(Restrictions.eq(property, value));
        return criteria.list();
    }


Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping schema="jrnl">

    <class name="com.philip.journal.home.bean.Branch" table="BRANCH" schema="jrnl" lazy="false">
        <meta attribute="class-description">
            Represents a branch of a Node in the Journal Application.
    </meta>

        <id name="branchId" type="long" length="16">
            <meta attribute="scope-set">public</meta>
            <column name="BRANCH_ID" />
            <generator class="increment" />
        </id>

        <property name="name" type="string" not-null="true" length="16" />

        <many-to-one class="com.philip.journal.home.bean.Branch" fetch="select" name="parent" not-null="false"
            column="PARENT_ID"/>

        <!--
            <set name="children" cascade="all" inverse="true"> <key column="PARENT_ID" /> <one-to-many
            class="com.philip.journal.home.bean.Branch" /> </set>
        -->

        <many-to-one class="com.philip.journal.core.bean.User" fetch="select" name="creator" column="CREATE_ID" />
        <many-to-one class="com.philip.journal.core.bean.User" fetch="select" name="updater" column="UPDATE_ID" />

        <property name="createDate" type="date">
            <column name="CREATE_DATE" length="13" not-null="false" />
        </property>
        <property name="createTime" type="time">
            <column name="CREATE_TIME" length="21" not-null="false" />
        </property>

        <property name="updateDate" type="date">
            <column name="UPDATE_DATE" length="13" not-null="false" />
        </property>
        <property name="updateTime" type="time">
            <column name="UPDATE_TIME" length="21" not-null="false" />
        </property>
    </class>
</hibernate-mapping>


Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping schema="jrnl">

    <class name="com.philip.journal.home.bean.Entry" table="ENTRY" schema="jrnl" lazy="false">
        <meta attribute="class-description">
            Represents a journal entry in Journal Application.
    </meta>
        <id name="entryId" type="long" length="16">
            <meta attribute="scope-set">public</meta>
            <column name="ENTRY_ID" />
            <generator class="increment" />
        </id>

        <property name="title" type="string" not-null="true" length="128" column="TITLE" />
        <property name="description" type="string" not-null="true" length="1024" column="DESCRIPTION" />

        <many-to-one class="com.philip.journal.home.bean.Branch" fetch="select" name="branch" not-null="true"
            column="BRANCH_ID" />

        <many-to-one class="com.philip.journal.core.bean.User" fetch="select" name="creator" column="CREATE_ID" />
        <many-to-one class="com.philip.journal.core.bean.User" fetch="select" name="updater" column="UPDATE_ID" />

        <property name="createDate" type="date">
            <column name="CREATE_DATE" length="13" not-null="false" />
        </property>
        <property name="createTime" type="time">
            <column name="CREATE_TIME" length="21" not-null="false" />
        </property>

        <property name="updateDate" type="date">
            <column name="UPDATE_DATE" length="13" not-null="false" />
        </property>
        <property name="updateTime" type="time">
            <column name="UPDATE_TIME" length="21" not-null="false" />
        </property>
    </class>

</hibernate-mapping>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.