-->
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: dynamic instantiation HQL question
PostPosted: Thu Jun 16, 2005 11:40 am 
Newbie

Joined: Tue Jun 14, 2005 12:44 pm
Posts: 19
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3.0

Here goes: I am creating an object through dynamic instantiation.


Code:
String queryString = "select new MessageSummary (message.messageId,message.MessageType,repository.EntityName,
session, elements(message.fields))";
queryString+= " from  MessageDBObject message,  SessionDBObject session, RepositoryObjectDBObject repository where message.MessageArrivalTime between :started and :ended";


I receive a query syntax error because "no appropriate constructor was found" - referring to the last parameter in my constructor, the 'elements' query.

My question is this - what does the HQL return when it runs elements?
I am trying to get a collection of message fields (mapped as contained as a list inside MessageDBObj). I cannot see what this elements query returns and thus am really going on a limb trying to get it out.

Another question - I am trying to get a list of message fields using
the 'elements' keyword - how can I limit the fields in the list to only ones with particular field name? Is this possible?

Thanks in advance to everyone out there wiliing to give a hand to a newbie from the near east.
Eyal


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