-->
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: Does the Criteria support dynamic-component ?
PostPosted: Thu Mar 01, 2007 12:34 pm 
Newbie

Joined: Wed Feb 28, 2007 8:26 am
Posts: 1
Hello,

Does the Criteria support dynamic-component ?

I have following codde:
Criteria criteria = session.createCriteria( MyClass.class);
criteria.addOrder(Order.asc("dynComp.String['name of field']")); // dynComp is a dynamic-component
criteria.list();

and I reveice exception:
could not resolve property: dynComp.String['name of field'] of: MyClass

I tried also others possibilities e.g. criteria.addOrder(Order.asc("dynComp.name_of_field_in_db"]));

More details
Hibernate 3.2.1
Application-Server: Tomcat 5.5
DB: mysql

hibernate file:
<?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>

<class name="DataClass" table="data" abstract="true">
<id name="id" column="data_id" length="36">
<generator class="uuid">
<param name="separator">-</param>
</generator>
</id>
<discriminator column="data_class" type="string" />
<many-to-one name="Login" column="login_id" embed-xml="false" />
<property name="priority" type="integer">
<column name="priority" />
</property>

<subclass name="MyClass" discriminator-value="MyClass">
<join table="my_data">
<key column="id" />

<dynamic-component name="dynamic">
<property name="Company Name" column="company_name" type="string" />
<property name="Address 1" column="address_1" type="string" />
.
.
(more properties)
</dynamic-component>

<component name="ImportDate" class="ImportDate">
<property name="created" type="timestamp" />
<property name="updated" type="timestamp" />
<property name="removed" type="timestamp" />
</component>
</join>
</subclass>

</class>

</hibernate-mapping>

with best regards,
Rafal


Top
 Profile  
 
 Post subject: Re: Does the Criteria support dynamic-component ?
PostPosted: Thu Jul 28, 2011 7:05 am 
Newbie

Joined: Thu Jul 28, 2011 6:33 am
Posts: 1
I've got the same problem/question...
so does anyone know?


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.