[prev in list] [next in list] [prev in thread] [next in thread]
List: jibx-users
Subject: Re: [jibx-users] Modeling recursive structures in XML and JiBX
From: Dennis Sosnoski <dms () sosnoski ! com>
Date: 2005-06-01 22:09:55
Message-ID: 429E3233.7000000 () sosnoski ! com
[Download RAW message or body]
Seems like it shouldn't be too hard. You'd need a Java object for the
condition, which has the comparison value and a reference to the
operator (which I assume is going to be optional, since otherwise you'd
always have an infinite tree). Then the binding would be something like
this:
<mapping class="ConditionClass" abstract="true">
<value name="comparison" field="m_comparison"/>
<structure field="m_operator" usage="optional"/>
</mapping>
<mapping class="AndOperatorClass" name="and">
<collection field="m_conditions" item-type="ConditionClass"/>
</mapping>
...
There may have been problems with this approach (using an abstract
mapping as the type of item for a collection) in RC0, but I believe at
least some variation of this works with the current CVS code.
- Dennis
Dan Cooperstock wrote:
>I'm trying to model recursive structures, like something that allows me
>to build a SQL WHERE clause. That means it can include comparisons (like
>a = b), and, or, and not. The problem I'm having is that I can't seem to
>get it as simple as I'd like.
>
>What I want is to have a condition be a <comparison>, an <and>, an <or>,
>or a <not>. An <and> contains two or more conditions, as does an <or>,
>and a <not> contains one condition. But I can't seem to figure out how
>to model that without introducing an extra <condition> element that has
>to wrap each condition within an <and> or an <or>. I don't have that
>problem with <not>.
>
>Any bright ideas? Thanks.
>
>-------------------------------------------------------------------
>Dan Cooperstock, Senior Software Developer, Quest Software
>260 King St. E., Toronto ON Canada M5A 4L5
>dan.cooperstock@quest.com 416-933-5165
>
>With Quest Software, you can expect more ... more performance, more
>productivity, more value from your IT investments.
>
>Visit www.quest.com to learn how.
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by Yahoo.
>Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
>Search APIs Find out how you can build Yahoo! directly into your own
>Applications - visit http://developer.yahoo.net/?fr_______________________________________________
>jibx-users mailing list
>jibx-users@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>
>
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic