List Info

Thread: getting the document (global type) on-the-fly from content types




getting the document (global type) on-the-fly from content types
country flaguser name
United States
2007-09-14 03:18:42
will try my best to describe my managing of XMLBeans as
clear as possible
(...mission impossible)...

using DB2 Viper (9) which allows for XML columns.  have
tables with mixed
content (book keeping stuff in normal tabular columns and
detailed - ITIL -
information in XML columns).  using Hibernate as my DAO
broker and for XML
columns have created a user type which reads in the XML
column data as
string and through the XmlObject.Factory.parse pumps into
the corresponding
POJO a XmlObject (which is a XmlBeans document i.e.
inclusive the schema).
the POJO objects trickle up through a service layor and
finally out with DWR
into an Ajax web application.  pretty smooth since
everything to the Ajax
components is a giant POJO (or JSON object in the javascript
world).

problem is this: the data i model represents ITIL elements
(i.e. resources
like servers/databases/etc.).  these resources are
subclassed into a huge
heirachy whereby at the top i have a baseElement class. 
when working with
XmlBeans i have designed my schemas so that resources down
the ITIL tree
extend from a couple core schemas and the schema standing
for the
baseElement (ancestor class).  everything works fine until i
want to do
similar subclassing of the POJOs in Java from their direct
parent because i
am tranforming the XML column data into XmlBean documents
(not the content
type - or root).  for example, if i have a package bean
(POJO) with a XML
schema that extends the software bean's schema which has
baseElement as an
ancestor right now my POJO just extends the BaseElement POJO
(which has no
XML columns mapped in it's Hibernate XML configuration -
only the subclassed
POJO have XML properties) since the XmlBean Documents do not
inherit from
each other (for obvious reasons - different namespaces).  if
i could
transform in my Hibernate user type "on-the-fly"
directly to the content
type (root) into a POJO property then the POJOs could extend
each (mirroring
the schema hierachy).

not sure how to within the Hibernate user type upon reading
the XML column
data (string which i must have the global element type i.e.
a complete XML
document) suck out the content type (root) in a general way.
 remember the
data about resources is in the same table (called
baseelement) with a
discriminator column (called type) and houses different
schemas in it's XML
columns.  so in the Hibernate user type i get the schematype
by parsing and
know it is a document but no clue how to pull the root?

same problem when persisting.  if my POJO just carry the
content type when
saving the Hibernate user type must first add the content
type (root) to a
new document and finally write (xmlText) that object into
the XML data
(otherwise i don't get my global type and essentially have
no idea what the
owning schema is).  need some dynamic way to associate
content types to
documents.

simple description?  right.  any suggestions would be
killer.
-- 
View this message in context: http://www.nabble.com/getting-the-document-%28global-type
%29-on-the-fly-from-content-types-tf4440881.html#a12670636
Sent from the Xml Beans - User mailing list archive at
Nabble.com.


------------------------------------------------------------
---------
To unsubscribe, e-mail: user-unsubscribexmlbeans.apache.org
For additional commands, e-mail: user-helpxmlbeans.apache.org


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )