-->
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: Criteria parsing
PostPosted: Fri Oct 05, 2007 5:56 am 
Newbie

Joined: Thu Oct 04, 2007 10:32 am
Posts: 6
Hi,
how can i parse a Criteria object which contains some levels of Subcriterias in it?

I can get all the Subcriterias of a Criteria, but how to get all the Subcriterias from a Subcriteria? And eventually hot to get all the restrictions which are applied on a certain Subcriteria?

Please advice.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 05, 2007 9:56 am 
Newbie

Joined: Thu Oct 04, 2007 10:32 am
Posts: 6
Ok, i will respond myself to my problem, as usual on this forum:
The implementation of Criteria is a little poor.

There are Top level criterias, known as CriteriaImpl and subcriterias known as CriteriaImpl.Subcriteria....

there should not be any problem with that, but:

ALL the subcriterias you create on that CriteriaImpl, no matter they are Subcriterias of other Subcriterias, they ALL are stored in a list, no matter the adding level - so, you have to itere trought the list until you get tired of it.

Same issue is at the criterions stored...you cannot get the criterions for a subcriteria for example, unless you iterate like a maniac trough them... :(

As like this wasn't enough, there's more:

public Iterator iterateExpressionEntries() { --> Should be called iterateCriterionEntries -> it does a lot of confusion, because it returs
criterionEntries.iterator();

The last, but not the smallest:

you have a private Map fetchModes = new HashMap();...well..there's no accessor method for this...but, there are accessor methods for the elements inside the map :
public FetchMode getFetchMode(String path) {
return (FetchMode) fetchModes.get(path);
}

Maybe some of you will say this is unnecessarely...what if i want to convert my criteria into an xml and then back?


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.