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.
|