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: Criteria.List<T> does not return anything
PostPosted: Wed Apr 02, 2008 10:07 am 
Regular
Regular

Joined: Tue Oct 16, 2007 9:45 am
Posts: 93
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

CreateCriteria.List<T> is not returning anything, I mean it returns an empty list. Should it not return Invoices. "T" passed in is of type Invoice as it has been mapped.
Need help with this, as I am just starting to learn NHibernate.

Hibernate version: 1.2.1

Mapping documents:
<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping
xmlns="urn:nhibernate-mapping-2.2"
schema=""
default-cascade="none"
auto-import="true"
assembly="Intelliun.Core" namespace="Intelliun.Core.Entities.billing"
>
<class name="Invoice"
table="INVOICE"
lazy="true"
>
<id name = "RecordId"
type = "Guid"
column="VEOID"
unsaved-value="0"
access="property"
>
<generator class="guid.comb"></generator>
</id>
<property name = "number"
column = "NUMBER"
type = "String"
access="field.camelcase-underscore"
/>
<property name = "date"
column = "DATE"
access="field.camelcase-underscore"
/>
<property name = "unpaidBalance"
column = "UNPAID_BALANCE"
access="field.camelcase-underscore"
/>


</class>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():
public ISession NHSession
{
get
{
if (_nhSession == null)
{
_nhSession = NHibernateHelper.GetCurrentSession();
}
return _nhSession;
}
set
{
_nhSession = value;
}
}


public EntityBag<T> FindAll<T>() where T : EntityBase
{
try
{
return new EntityBag<T>(NHSession.CreateCriteria(typeof(T)).List<T>());

}
catch (HibernateException ex)
{
throw new InfrastrucureException(ex);
}
}

Full stack trace of any exception that occurs: No Exception

Name and version of the database you are using: MS SQL Express 2005


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.