Hi,

as both solutions give you the result that you want to see, both of them can be used. IT#s up to you which one you choose.

Regards


sweex schrieb:
Hi!

Well, I've found other solution: to assign null value to fields that I don't
want to map. Changing the mapping files is more efficient solution, isn't
it?

Regards



sweex wrote:
Thanks Ralf! This is what I'm going to do.
Regards


Ralf Joachim wrote:
Hi sweex,

it isn't possible to specify to mappings for one class in one mapping file. But why don't you use 2 different mapping files, one which maps all 3 fields of the class and the other that maps one the name. dependend on what you like to marshal/unmarshal you can use one or the other mapping file.

Regards
Ralf


sweex schrieb:
Hi Werner,

I'm sorry. I don't speak english very well and probably I haven't
explained
it right.

I have a class Person.java. It has, for example, 3 attributes/fields.
public class Person {
   private String name;
   private int age;
   private String country;
...
  // get/set methods
...
}


I want to define two different mappings of this class, because sometimes
I
will need to map a person with its 3 fields, but other times I only will
need its "name" field. As I've read at Castor's documentation:


"
Nested class mapping

Since 0.9.5.3, the bind-xml element supports a nested class mapping,
which
is often useful when needing to specify more than one mapping for a
particular class. A good example of this is when mapping
Hashtable/HashMap/Map."

I understand the example, but there is no multiple mapping for a unique
class. I don't know how can I do it!

That's it.

Thanks!!



Werner Guttmann wrote:

Hi,

Not sure what you are trying to achieve, to be honest. Can you please
elaborate your thoughts ?

Thanks
Werner

sweex wrote:

hello!!!


My question is very simple:
How can I define more than one mapping for a particular class using
nested
class mapping?
Thanks!!



---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email






--

Syscon Ingenieurbüro für Meß- und Datentechnik GmbH
Ralf Joachim
Raiffeisenstraße 11
72127 Kusterdingen
Germany

Tel.   +49 7071 3690 52
Mobil: +49 173 9630135
Fax    +49 7071 3690 98

Internet: www.syscon.eu
E-Mail: [EMAIL PROTECTED]

Sitz der Gesellschaft: D-72127 Kusterdingen
Registereintrag: Amtsgericht Stuttgart, HRB 382295
Geschäftsleitung: Jens Joachim, Ralf Joachim

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to