-->
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: colletcions fields and direct sql query
PostPosted: Fri Sep 03, 2004 4:52 am 
Newbie

Joined: Fri Oct 17, 2003 6:11 am
Posts: 15
Hibernate version: 2.1
Mapping documents:
<!DOCTYPE hibernate-mapping SYSTEM "C:\java\eclipse\workspace\portal\hibernate-mapping-2.0.dtd">
<hibernate-mapping default-cascade="save-update" package="it.rvspm.siscotel.portal.dao">
<!-- WebObject Class -->
<class name="it.rvspm.siscotel.portal.dao.WebObject" table="WEBOBJECT">
<meta attribute="extends">
it.rvspm.siscotel.portal.dao.AbstractWebObject
</meta>
<id name="id" type="long">
<column name="id"/>
<generator class="native"/>
</id>
<property name="published" type="boolean"/>
<property name="template" type="string"/>
<!-- Metadata -->
<property name="createdby" type="string"/>
<property name="itemType" type="string"/>
<property name="created" type="date"/>
<property name="expire" type="date"/>
<property name="modified" type="date"/>
<property name="modifiedby" type="string"/>
<!-- More then one??? -->
<property name="category" type="string"/>
<!-- Nome del comune -->
<property name="owner" type="string"/>

<joined-subclass name="it.rvspm.siscotel.portal.dao.Page" table="PAGE">
<key column="id" foreign-key="pageId"/>
<property name="title" type="string"/>
<property name="name" type="string"/>
<property name="navBarposition" type="long"/>
<set name="pubblications" inverse="true" cascade="all" order-by="horizzontalposition asc">
<key column="page"/>
<one-to-many class="it.rvspm.siscotel.portal.dao.Pubblication"/>
</set>
<set name="subpages" >
<key column="superpage"/>
<one-to-many class="it.rvspm.siscotel.portal.dao.Page"/>
</set>
</joined-subclass>
.....

Code between sessionFactory.openSession() and session.close():
...
String queryString = "select page.superpage from Page as page, where page.id = "+currentPage.getId();
....

Full stack trace of any exception that occurs:

Name and version of the database you are using:
M$SQL with Jtds

Debug level Hibernate log excerpt: on

I' d like to get the "page.superpage" field with a query, I have traied with sql native hibernate query (session.createSQL(.,.,P.Class)), but I don't know what peristance class param (P.Class) I have to use becouse i need only the long vlaue field page.superpage.

Can anyone help me?
Thanks in advance
Stefano


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 03, 2004 5:07 am 
Regular
Regular

Joined: Wed Aug 18, 2004 5:16 am
Posts: 69
Location: Modena, Italy
If you need the superpage id try:
Code:
String queryString = "select page.superpage.id from Page as page, where page.id = "+currentPage.getId();


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.