Tobias,
I am the same process now and have a related question.
I looked in the jbosstest and zola but did not find any examples.

If I have a Entity Bean User with properties
        public String firstName;
        public String lastName;
        public Address address;

With an Address "JavaBean" (private attributes, get/set methods) : line1,
line2, city, country ALL String.

I have a table USER with FIELD FIRSTNAME, LASTNAME, LINE1, LINE2, CITY and
COUNTRY.

firstName and latsName will be maped automatically.  OK.

Is not possible to define a special jaws.xml that will map automatically the
Address'fields to my database using something like
         <ejb-name>User</ejb-name>
         <table-name>USER</table-name>
           <cmp-field>
            <field-name>address.line1</field-name>
            <column-name>LINE1</column-name>
            <jdbc-type>VARCHAR</jdbc-type>
            <sql-type>VARCHAR(256)</sql-type>
         </cmp-field>

            etc ...

I think WxxxLxxC do that.  (do not take that as a critic or anything
similar, just a remark)

I have ONE table so that would be a great feature to have in CMP 1.1.

Vincent.

-----Message d'origine-----
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]De la part de Tobias Frech
Envoye : vendredi 29 decembre 2000 6:21
A : jBoss
Objet : Re: [jBoss-User] Custom attributes with CMP


Hi Christophe!
With JBoss/JAWS you do not need to do any additional thing. Just some
things you should think of:

1) An object as a property will be serialized (-> must "implement"
serializable) and stored as a BLOB in the database.

2) Be careful when changing the implementation of the serialized
objects. The stored objects may not be deserializable again if the old
version is still in the DB. Check this first ! (Has anyone some
experience when this will be a problem ?)

3) If the object is another CMP bean JAWS will take care of it and only
store the handler (as a reference to the bean) and will not stored it as
a serialized object.

4) Check how 1) and 3) will work with other application server vendors.
I have no experience in this field. Anyone else ?

5) If your standard mapping for you database for JAWS comes with a
mapping for java.lang.Object you don't need any _special_ tags in the
XML file(s). Nevertheless you need to declare the object property as a
CMP field in ejb-jar.xml. Here EJX could be helpful for you (comes with
jBoss).

6) Any more questions ?

Tobias




Christophe Demez wrote:
>
> Hi,
>
> I have create a CMP Bean with several attributes.
>
> I have also create a custom class MyBoolean that must contains some
boolean
> values, each boolean
> value in my Bean should be a MyBoolean !
>
> What do I need to do to support other type than the standard Java Type ?
>
> - I need to implement some interface
> - I need to rewrite some methods
> - DO I need to specivy this in some XML files
>
> (I currently use JBoss, but I need to use some others one later !!)
>
> Thanks a lot for your help
>
> Christophe Demez
> BIMACO
>
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> List Help?:          [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]


.

QUIT

[EMAIL PROTECTED]

List Help?:          [EMAIL PROTECTED]



.

QUIT




--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to