castor

Filter on current date within Castor OQL

I'm running the java cocoon 2 and castor oql. I'm trying to filter my oql query by today's date, but I can't seem to figure out (or find in google) the syntax of the date. The database is mySql, but the oql is mapped by the java classes... so doing a search on field_date >= Now() doesn't work. Any ideas? I really can't stand the limit...

Java XML Binding

What are you using for binding XML to Java? JAXB, Castor, and XMLBeans are some of the available choices. The comparisons that I've seen are all three or four years old. I'm open to other suggestions. Marshalling / unmarshalling performance and ease of use are of particular interest. Clarification: I'd like to see not just what framewor...

Castor performance issues

We recently upgraded to Castor 1.2 from version 0.9.5.3 and we've noticed a dramatic drop in performance when calling unmarshal on XML. We're unmarshaling to java classes that were generated by castor in both cases. For comparison, using identical XML the time for the XML unmarshal call used to take about 10-20ms and now takes about 23...

Webservice with castor Serialzer

Does anyone know how to generate an axis webservice with castor serializer / deserializer? Current situation: axis webservice has to be build from wsdl with xsd and castor serialization build process has to be automated with an ant script the standard way is to create webservice sources with wsdl2java and then replace the pojos with t...

Castor compilation of schema produces different class hierarchy depending on elements in schema.

While mataining a castor based system, I amend the source schema to produce a new set of classes and find that introducing a new element produces a different class hierarchy. This is true of any element type. Briefly, the current schema creates class foo which extends fooParent which extends fooGrandparent. Introduce a new element in t...

Java: Using Castor XML with images

Hey, how can I use Castor XML to marshal a java.awt.Image object to XML, or make the XML reference the image in some way. Cheers, Pete ...

Java castor using custom field handlers

Hey, I have been trying to write a custom field handler which returns the hash code of a java.awt.Image object when writing to XML and retrieves an image based on this hash code when binding the XML to an object. For some reason, I can't get this to work; castor, from what I can tell, simply instantiates the field handler and then does...

How can I handle Castor unmarshaling of SOAP messages when the namespace is defined inside the operation tag?

I am developing a contract-first web service based on Spring-WS. I'm relying on Castor marshaling, and I have run into the following issue. Requests are being accepted when the "xmlns" namespace is defined in the Envelope tag, such as: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns="h...

Is it possible to have Castor marshal/unmarshal an EnumMap?

I'm using Castor to marshal/unmarshal my Java objects, one of which contains an EnumMap. Can Castor marshal/unmarshal EnumMaps? I have a mapping file with some nested HashMaps, but I've never pushed an EnumMap through Castor. If it is possible, how is it done through the mapping file? ...

Castor 1.2 for POJO to XML

I am using Castor 1.2 for marshalling. Do you have any experience with using Castor for this purpose? Do you have suggestions for improving performance? ...

Castor unmarshalling exception demanding provided field

I have this schema: <?xml version="1.0" encoding="utf-8" ?> <xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; <xs:element block="" final="" name="mensaje"> <xs:complexType> <xs:all> <xs:element minOccurs="1" maxOccurs="1" name="identificacion" type="Head" /> <xs:element...

JPOX JDO and Castor JDO compared to Hibernate persistence

Do these frameworks (JPOX JDO and Cater JDO) work off similar principles as Hibernate? Do they use configuration data plus a combination of reflection and generics? What are some of the major architectural differences? ...

Transitioning from Castor to JPA

I am trying to make my java application more standards compliant and one of the biggest issues i am facing is transitioning our ORM framework from Castor JDO to a JPA implementation (thinking either Hibernate or DataNucleus). We have our own persistent data abstraction layer so the basic refactoring can easily be done by adding a JPA imp...

Tool for importing Excel spreadsheets

Hi, I need to import some Excel spreadsheets into Java objects. I will use POI to do the task (an old version of it unfortunately). However I wonder if there is some high-level framework to do the same task but declaratively. I'm thinking in Castor and XML. The mapping Excel-Class will be stored in a resource (e.g. an XML file). Yes, I'...

Castor and IKVM

I've converted an api written in Java into a .net dll using IKVM, and so far it's been good. It basically uses xml behind the scenes to access some web services. The api is 3rd party, and I have no access to the source code. The api uses Castor to (I believe) bind xml into objects. However, when I started to use some of the more usef...

Castor Collection Field to empty

My castor masrshaller have an XML output as below root> field1 /field1> field2 /field2> .......... fieldn> collection> field> field> .......... field> /collection> /root> my mapping for the collection part is field name="collectionObj" type="string" collection="arraylist"> bind-xml name="...

How can I work around Castor's default behaviour to create wrapper classes for complexType elements?

I'm using Castor XML code generator. If you have two schemas with complexTypes defined as follows: <xs:schema ...blah...> <xs:complexType name="FooBarType"> <xs:sequence> <xs:element name="meh"/> ...etc... </xs:sequence> </xs:complexType> <xs:element name="FooBar"/> </xs:schema> and <xs:schema ...blah ...> ...

Mapping collection to XML in Castor

Hi, I'm trying to map a POJO to XML using Castor. Let's say I have a Order that has a collection of Items... is there any way of achieving an xml like the following: <order> ...order attributes <items> <item> ..item attributes </item> <item> ..other item </item> </items> </order> I could make something similar but wit...

Unmarshalling related XML elements within different subtrees

Good day to you, I use Castor to map network infrastructure into Java classes. My XML file looks like this: <SPECTRUM_Topology> <Topology> <!-- Device information --> <Device ip_dnsname="172.20.162.1" ... /> </Topology> <Update> <Device ip_dnsname="172.20.162.1"> <!-- Port information --> <Port ... /> ...

Castor and sockets

I'm new to Castor and data binding in general. I'm working on an application that, in part, needs to take data off of a socket and unmarshall the data to make POJOs. Now, I've got the socket stuff down, and I've even generated and compiled java files thanks to Ant and Castor. Here's the problem: the data stream that I'll receive could b...