Mapping fields only for sql or xml

View: New views
5 Messages — Rating Filter:   Alert me  

Mapping fields only for sql or xml

by Kreyßel, Conny :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hello,

has anyone a idea how to enable field mapping only for xml or only for sql.

Example:

I have a class

Container {
        int a;
       
        // database field
        public void setA(int a){this.a=a}
        public int getA(){return a;}

        // only xml fields
        public void setXmla(boolean xmla){this.a = a | 1;}
        public int getXmla(){return a & 1 == 1;}
       
        public void setXmlb(boolean xmla){this.a = a | 2;}
        public int getXmlb(){return a & 2 == 2;}

        public void setXmlc(boolean xmla){this.a = a | 4;}
        public int getXmlc(){return a & 4 == 4;}}
        ...
        ...
}

Can I create a mapping that only the attribute a maps to/from database and xmla-c attributes maps to/from xml?

--

Best regards

Conny Kreyßel
INTER-FORUM Software Services GmbH
Sommerfelder Straße 120
04316 Leipzig


EMail: mailto:conny.kreyssel@...

WWW  : http://www.inter-forum.de

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

    http://xircles.codehaus.org/manage_email



Re: Mapping fields only for sql or xml

by Werner Guttmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, you can.

Werner


Kreyßel wrote:

> hello,
>
> has anyone a idea how to enable field mapping only for xml or only for sql.
>
> Example:
>
> I have a class
>
> Container {
> int a;
>
> // database field
> public void setA(int a){this.a=a}
> public int getA(){return a;}
>
> // only xml fields
> public void setXmla(boolean xmla){this.a = a | 1;}
> public int getXmla(){return a & 1 == 1;}
>
> public void setXmlb(boolean xmla){this.a = a | 2;}
> public int getXmlb(){return a & 2 == 2;}
>
> public void setXmlc(boolean xmla){this.a = a | 4;}
> public int getXmlc(){return a & 4 == 4;}}
> ...
> ...
> }
>
> Can I create a mapping that only the attribute a maps to/from database and xmla-c attributes maps to/from xml?
>
> --
>
> Best regards
>
> Conny Kreyßel
> INTER-FORUM Software Services GmbH
> Sommerfelder Straße 120
> 04316 Leipzig
>
>
> EMail: mailto:conny.kreyssel@...
>
> WWW  : http://www.inter-forum.de
>
> ---------------------------------------------------------------------
> 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



AW: Mapping fields only for sql or xml

by Kreyßel, Conny :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, the class should look like  

Container {
        int a;
       
        // database field
        public void setA(int a){this.a=a}
        public int getA(){return a;}

        // only xml fields
        public void setXmla(boolean xmla){this.a = a | 1;}
        public boolean isXmla(){return a & 1 == 1;}
       
        public void setXmlb(boolean xmla){this.a = a | 2;}
        public boolean isXmlb(){return a & 2 == 2;}

        public void setXmlc(boolean xmla){this.a = a | 4;}
        public boolean isXmlc(){return a & 4 == 4;}}
        ...
        ...
}


--

Mit freundlichen Grüßen

Conny Kreyßel
INTER-FORUM Software Services GmbH
Sommerfelder Straße 120
04316 Leipzig

Tel. : +49-341-25 92 099
Fax  : +49-341-25 92 021

EMail: mailto:conny.kreyssel@...

WWW  : http://www.inter-forum.de
       http://www.kompass302.de
       http://www.rezept300.de

Registergericht: Amtsgericht Leipzig
Registernummer:  HRB 16359
Geschäftsführer: Claus Wippich, Steffen Krause
UST-IdNr.:       DE 113590752
IK:              661430057

-----Ursprüngliche Nachricht-----
Von: Kreyßel, Conny [mailto:Conny.Kreyssel@...]
Gesendet: Montag, 11. August 2008 15:00
An: dev@...
Betreff: [castor-dev] Mapping fields only for sql or xml

hello,

has anyone a idea how to enable field mapping only for xml or only for sql.

Example:

I have a class

Container {
        int a;
       
        // database field
        public void setA(int a){this.a=a}
        public int getA(){return a;}

        // only xml fields
        public void setXmla(boolean xmla){this.a = a | 1;}
        public int getXmla(){return a & 1 == 1;}
       
        public void setXmlb(boolean xmla){this.a = a | 2;}
        public int getXmlb(){return a & 2 == 2;}

        public void setXmlc(boolean xmla){this.a = a | 4;}
        public int getXmlc(){return a & 4 == 4;}}
        ...
        ...
}

Can I create a mapping that only the attribute a maps to/from database and xmla-c attributes maps to/from xml?

--

Best regards

Conny Kreyßel
INTER-FORUM Software Services GmbH
Sommerfelder Straße 120
04316 Leipzig


EMail: mailto:conny.kreyssel@...

WWW  : http://www.inter-forum.de

---------------------------------------------------------------------
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



AW: Mapping fields only for sql or xml

by Kreyßel, Conny :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you for yout fast but very short response. :-)

But the question is how???


--

Mit freundlichen Grüßen

Conny Kreyßel
INTER-FORUM Software Services GmbH
Sommerfelder Straße 120
04316 Leipzig

Tel. : +49-341-25 92 099
Fax  : +49-341-25 92 021

EMail: mailto:conny.kreyssel@...

WWW  : http://www.inter-forum.de
       http://www.kompass302.de
       http://www.rezept300.de

Registergericht: Amtsgericht Leipzig
Registernummer:  HRB 16359
Geschäftsführer: Claus Wippich, Steffen Krause
UST-IdNr.:       DE 113590752
IK:              661430057

-----Ursprüngliche Nachricht-----
Von: Werner Guttmann [mailto:werner.guttmann@...]
Gesendet: Montag, 11. August 2008 15:34
An: dev@...
Betreff: Re: [castor-dev] Mapping fields only for sql or xml

Yes, you can.

Werner


Kreyßel wrote:

> hello,
>
> has anyone a idea how to enable field mapping only for xml or only for sql.
>
> Example:
>
> I have a class
>
> Container {
> int a;
>
> // database field
> public void setA(int a){this.a=a}
> public int getA(){return a;}
>
> // only xml fields
> public void setXmla(boolean xmla){this.a = a | 1;}
> public int getXmla(){return a & 1 == 1;}
>
> public void setXmlb(boolean xmla){this.a = a | 2;}
> public int getXmlb(){return a & 2 == 2;}
>
> public void setXmlc(boolean xmla){this.a = a | 4;}
> public int getXmlc(){return a & 4 == 4;}}
> ...
> ...
> }
>
> Can I create a mapping that only the attribute a maps to/from database and xmla-c attributes maps to/from xml?
>
> --
>
> Best regards
>
> Conny Kreyßel
> INTER-FORUM Software Services GmbH
> Sommerfelder Straße 120
> 04316 Leipzig
>
>
> EMail: mailto:conny.kreyssel@...
>
> WWW  : http://www.inter-forum.de
>
> ---------------------------------------------------------------------
> 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



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

    http://xircles.codehaus.org/manage_email



Re: AW: Mapping fields only for sql or xml

by Werner Guttmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Conny,

have you had a look at

http://castor.org/xml-mapping.html

and

http://castor.org/jdo-mapping.html

that show the syntax that is relevant to map a given Java class/member
to  XML and/or JDO.

Regards
Werner

Kreyßel wrote:

> Sorry, the class should look like  
>
> Container {
> int a;
>
> // database field
> public void setA(int a){this.a=a}
> public int getA(){return a;}
>
> // only xml fields
> public void setXmla(boolean xmla){this.a = a | 1;}
> public boolean isXmla(){return a & 1 == 1;}
>
> public void setXmlb(boolean xmla){this.a = a | 2;}
> public boolean isXmlb(){return a & 2 == 2;}
>
> public void setXmlc(boolean xmla){this.a = a | 4;}
> public boolean isXmlc(){return a & 4 == 4;}}
> ...
> ...
> }
>
>
> --
>
> Mit freundlichen Grüßen
>
> Conny Kreyßel
> INTER-FORUM Software Services GmbH
> Sommerfelder Straße 120
> 04316 Leipzig
>
> Tel. : +49-341-25 92 099
> Fax  : +49-341-25 92 021
>
> EMail: mailto:conny.kreyssel@...
>
> WWW  : http://www.inter-forum.de
>        http://www.kompass302.de
>        http://www.rezept300.de
>
> Registergericht: Amtsgericht Leipzig
> Registernummer:  HRB 16359
> Geschäftsführer: Claus Wippich, Steffen Krause
> UST-IdNr.:       DE 113590752
> IK:              661430057
>
> -----Ursprüngliche Nachricht-----
> Von: Kreyßel, Conny [mailto:Conny.Kreyssel@...]
> Gesendet: Montag, 11. August 2008 15:00
> An: dev@...
> Betreff: [castor-dev] Mapping fields only for sql or xml
>
> hello,
>
> has anyone a idea how to enable field mapping only for xml or only for sql.
>
> Example:
>
> I have a class
>
> Container {
> int a;
>
> // database field
> public void setA(int a){this.a=a}
> public int getA(){return a;}
>
> // only xml fields
> public void setXmla(boolean xmla){this.a = a | 1;}
> public int getXmla(){return a & 1 == 1;}
>
> public void setXmlb(boolean xmla){this.a = a | 2;}
> public int getXmlb(){return a & 2 == 2;}
>
> public void setXmlc(boolean xmla){this.a = a | 4;}
> public int getXmlc(){return a & 4 == 4;}}
> ...
> ...
> }
>
> Can I create a mapping that only the attribute a maps to/from database and xmla-c attributes maps to/from xml?
>
> --
>
> Best regards
>
> Conny Kreyßel
> INTER-FORUM Software Services GmbH
> Sommerfelder Straße 120
> 04316 Leipzig
>
>
> EMail: mailto:conny.kreyssel@...
>
> WWW  : http://www.inter-forum.de
>
> ---------------------------------------------------------------------
> 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
>
>

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

    http://xircles.codehaus.org/manage_email


LightInTheBox - Buy quality products at wholesale price!