-->
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.  [ 2 posts ] 
Author Message
 Post subject: Problem with ilike Restriction
PostPosted: Wed Jan 30, 2008 12:32 pm 
Newbie

Joined: Tue Jan 29, 2008 4:47 am
Posts: 2
Hello everybody.

When I create an IlikeExpression Object through the Restrictions.ilike method for doing a query to my Database, sending as first parameter the name of a property properly defined in the configuration file of hibernate and correctly mapped to a column of my database, and as second parameter, an object of type ContentType, which is also mapped to a table of my database, when I do a query with this restriction, hibernate shows me the next result:

Query:

DetachedCriteria criteria = createDetachedCriteria(criteriaCollection, null);
criteria.setProjection(Projections.rowCount());
resultList = daoService.findByCriteria(criteria);


in the criteriaCollection is saved the IlikeExpression Object.

And, this is the error:

IllegalArgumentException in class: com.onetwo.runtime.repository.contenttype.ContentType, getter method of property: fullName
[2008-01-29 10:00:29,044] [ERROR] [XSearchServiceImpl.java] [search] [26] IllegalArgumentException occurred calling getter of com.onetwo.runtime.repository.contenttype.ContentType.fullName; nested exception is org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.onetwo.runtime.repository.contenttype.ContentType.fullName
org.springframework.orm.hibernate3.HibernateSystemException: IllegalArgumentException occurred calling getter of com.onetwo.runtime.repository.contenttype.ContentType.fullName; nested exception is org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.onetwo.runtime.repository.contenttype.ContentType.fullName
Caused by: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.onetwo.runtime.repository.contenttype.ContentType.fullName
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:171)
at org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValue(AbstractComponentTuplizer.java:64)
at org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValues(AbstractComponentTuplizer.java:70)
at org.hibernate.tuple.component.PojoComponentTuplizer.getPropertyValues(PojoComponentTuplizer.java:86)
at org.hibernate.type.ComponentType.getPropertyValues(ComponentType.java:353)
at org.hibernate.type.ComponentType.nullSafeGetValues(ComponentType.java:326)
at org.hibernate.type.ComponentType.nullSafeSet(ComponentType.java:281)
at org.hibernate.loader.Loader.bindPositionalParameters(Loader.java:1707)

It is very strange because if I do the same query with the same parameters with an like restriction, the query works good.

The code of the ContentType Class is basically a bean with the properties defined on the hibernate configuration file, with the getters and setters properly defined.

This is a piece of code of the hibernate configuration file:

<class name="com.onetwo.runtime.repository.content.metadata.ContentMetadata" table="METADATA">
<cache usage="read-write"/>
.
.
.
<component name="contentType" class="com.onetwo.runtime.repository.contenttype.ContentType">
<property name="fullName" column="CONTENT_TYPE" type="java.lang.String" not-null="true"/>
</component>

.
.
.

the query is done on the METADATA table, but note that the contentType is a property of this table which type is ContentType.


Top
 Profile  
 
 Post subject: Re: Problem with ilike Restriction
PostPosted: Wed Jan 30, 2008 1:19 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
It's more like the getFullName method of ContentType is running into a problem. What is the method implementation? What is the full stack trace?



Farzad-


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

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.