You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Aaron Mulder <am...@alumni.princeton.edu> on 2005/07/01 20:39:18 UTC

CMP Field Mapping Required?

	It looks like our intention is that cmp-field-mappings are
required in openejb-jar.xml.  That is, a single schema sequence contains
the table name and one or more cmp-field-mappings, which kind of implies
that you can't leave out the cmp-field-mappings, though of course there's
no way for us to force you (via the schema) to include one for each CMP
field in ejb-jar.xml.  Also, we do currently throw a deployment error if
you forget a field.

	But I wonder whether this is all necessary.  We could just default
the column name to the CMP field name, so you would only need to provide
the mapping if they were different.  Likewise, we could default the table
name to the ejb-name and make that optional too.

	What does everyone think about allowing defaults like that?  I
think it would be handy for trivial demos/examples, and unlikely to be
used for real apps.  All else being equal, I'm happy to support easy 
examples.  But I'm not sure if people feel like explicit deployment errors 
would be better than using defaults if you try to map everything but 
forget one.

Aaron

Re: CMP Field Mapping Required?

Posted by Dain Sundstrom <da...@iq80.com>.
+1

-dain

On Jul 1, 2005, at 11:39 AM, Aaron Mulder wrote:

>     It looks like our intention is that cmp-field-mappings are
> required in openejb-jar.xml.  That is, a single schema sequence  
> contains
> the table name and one or more cmp-field-mappings, which kind of  
> implies
> that you can't leave out the cmp-field-mappings, though of course  
> there's
> no way for us to force you (via the schema) to include one for each  
> CMP
> field in ejb-jar.xml.  Also, we do currently throw a deployment  
> error if
> you forget a field.
>
>     But I wonder whether this is all necessary.  We could just default
> the column name to the CMP field name, so you would only need to  
> provide
> the mapping if they were different.  Likewise, we could default the  
> table
> name to the ejb-name and make that optional too.
>
>     What does everyone think about allowing defaults like that?  I
> think it would be handy for trivial demos/examples, and unlikely to be
> used for real apps.  All else being equal, I'm happy to support easy
> examples.  But I'm not sure if people feel like explicit deployment  
> errors
> would be better than using defaults if you try to map everything but
> forget one.
>
> Aaron
>


Re: CMP Field Mapping Required?

Posted by "Alan D. Cabrera" <li...@toolazydogs.com>.
On 7/1/2005 11:39 AM, Aaron Mulder wrote:

>	It looks like our intention is that cmp-field-mappings are
>required in openejb-jar.xml.  That is, a single schema sequence contains
>the table name and one or more cmp-field-mappings, which kind of implies
>that you can't leave out the cmp-field-mappings, though of course there's
>no way for us to force you (via the schema) to include one for each CMP
>field in ejb-jar.xml.  Also, we do currently throw a deployment error if
>you forget a field.
>
>	But I wonder whether this is all necessary.  We could just default
>the column name to the CMP field name, so you would only need to provide
>the mapping if they were different.  Likewise, we could default the table
>name to the ejb-name and make that optional too.
>
>	What does everyone think about allowing defaults like that?  I
>think it would be handy for trivial demos/examples, and unlikely to be
>used for real apps.  All else being equal, I'm happy to support easy 
>examples.  But I'm not sure if people feel like explicit deployment errors 
>would be better than using defaults if you try to map everything but 
>forget one.
>
Sounds like a good idea to me.


Regards,
Alan





Re: CMP Field Mapping Required?

Posted by Matt Hogstrom <ma...@hogstrom.org>.
Regarding the DDL I think we should probably generate the DDL and pop it in the ejb module that it was generated for (perhaps in the META-INF directory).  I prefer this approach as many DBAs do not like the idea of the infrastructure creating tables and prefer to do this themselves.  At least having our initial view of the DDL would help the DBAs out.  I'm +1 on the dynamic creation as for the developer it makes their lives a lot easier.

- Matt 

----- Original Message ----- 
From: "Dain Sundstrom" <da...@iq80.com>
To: <de...@geronimo.apache.org>
Sent: Saturday, July 02, 2005 1:50 PM
Subject: Re: CMP Field Mapping Required?


> +1 to Gianny's idea
> 
> Maybe we can had a "guessed" flag on all the implicit settings in the  
> DConfigBeans.   Then if someone sets it by hand we clear the flag.   
> I'm guessing this might not be practical, but it would be cool if it  
> could be done.
> 
> -dain
> 
> On Jul 1, 2005, at 10:00 PM, Gianny Damour wrote:
> 
> > +1
> >
> > Also, I think that we need to clearly display a warning message  
> > when an implicit mapping is infered.
> >
> > I also think that the underlying database schema should be  
> > automatically created upon deployment, if explicitely requested.  
> > And a standalone tool should be provided to generate a DML script.
> >
> > Thanks,
> > Gianny
> >
> > On 2/07/2005 4:39 AM, Aaron Mulder wrote:
> >
> >
> >>     It looks like our intention is that cmp-field-mappings are
> >> required in openejb-jar.xml.  That is, a single schema sequence  
> >> contains
> >> the table name and one or more cmp-field-mappings, which kind of  
> >> implies
> >> that you can't leave out the cmp-field-mappings, though of course  
> >> there's
> >> no way for us to force you (via the schema) to include one for  
> >> each CMP
> >> field in ejb-jar.xml.  Also, we do currently throw a deployment  
> >> error if
> >> you forget a field.
> >>
> >>     But I wonder whether this is all necessary.  We could just  
> >> default
> >> the column name to the CMP field name, so you would only need to  
> >> provide
> >> the mapping if they were different.  Likewise, we could default  
> >> the table
> >> name to the ejb-name and make that optional too.
> >>
> >>     What does everyone think about allowing defaults like that?  I
> >> think it would be handy for trivial demos/examples, and unlikely  
> >> to be
> >> used for real apps.  All else being equal, I'm happy to support  
> >> easy examples.  But I'm not sure if people feel like explicit  
> >> deployment errors would be better than using defaults if you try  
> >> to map everything but forget one.
> >>
> >> Aaron
> >>
> >>
> >
> 
> 
> 

Re: CMP Field Mapping Required?

Posted by Dain Sundstrom <da...@iq80.com>.
+1 to Gianny's idea

Maybe we can had a "guessed" flag on all the implicit settings in the  
DConfigBeans.   Then if someone sets it by hand we clear the flag.   
I'm guessing this might not be practical, but it would be cool if it  
could be done.

-dain

On Jul 1, 2005, at 10:00 PM, Gianny Damour wrote:

> +1
>
> Also, I think that we need to clearly display a warning message  
> when an implicit mapping is infered.
>
> I also think that the underlying database schema should be  
> automatically created upon deployment, if explicitely requested.  
> And a standalone tool should be provided to generate a DML script.
>
> Thanks,
> Gianny
>
> On 2/07/2005 4:39 AM, Aaron Mulder wrote:
>
>
>>     It looks like our intention is that cmp-field-mappings are
>> required in openejb-jar.xml.  That is, a single schema sequence  
>> contains
>> the table name and one or more cmp-field-mappings, which kind of  
>> implies
>> that you can't leave out the cmp-field-mappings, though of course  
>> there's
>> no way for us to force you (via the schema) to include one for  
>> each CMP
>> field in ejb-jar.xml.  Also, we do currently throw a deployment  
>> error if
>> you forget a field.
>>
>>     But I wonder whether this is all necessary.  We could just  
>> default
>> the column name to the CMP field name, so you would only need to  
>> provide
>> the mapping if they were different.  Likewise, we could default  
>> the table
>> name to the ejb-name and make that optional too.
>>
>>     What does everyone think about allowing defaults like that?  I
>> think it would be handy for trivial demos/examples, and unlikely  
>> to be
>> used for real apps.  All else being equal, I'm happy to support  
>> easy examples.  But I'm not sure if people feel like explicit  
>> deployment errors would be better than using defaults if you try  
>> to map everything but forget one.
>>
>> Aaron
>>
>>
>


Re: CMP Field Mapping Required?

Posted by Gianny Damour <gi...@optusnet.com.au>.
+1

Also, I think that we need to clearly display a warning message when an 
implicit mapping is infered.

I also think that the underlying database schema should be automatically 
created upon deployment, if explicitely requested. And a standalone tool 
should be provided to generate a DML script.

Thanks,
Gianny

On 2/07/2005 4:39 AM, Aaron Mulder wrote:

>	It looks like our intention is that cmp-field-mappings are
>required in openejb-jar.xml.  That is, a single schema sequence contains
>the table name and one or more cmp-field-mappings, which kind of implies
>that you can't leave out the cmp-field-mappings, though of course there's
>no way for us to force you (via the schema) to include one for each CMP
>field in ejb-jar.xml.  Also, we do currently throw a deployment error if
>you forget a field.
>
>	But I wonder whether this is all necessary.  We could just default
>the column name to the CMP field name, so you would only need to provide
>the mapping if they were different.  Likewise, we could default the table
>name to the ejb-name and make that optional too.
>
>	What does everyone think about allowing defaults like that?  I
>think it would be handy for trivial demos/examples, and unlikely to be
>used for real apps.  All else being equal, I'm happy to support easy 
>examples.  But I'm not sure if people feel like explicit deployment errors 
>would be better than using defaults if you try to map everything but 
>forget one.
>
>Aaron
>
>  
>


Re: CMP Field Mapping Required?

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
	The JSR-88 tool kind of does this (/ will do this) as a side
effect.  When you run it, the DConfigBean tree initializes itself from the
DDBean tree, meaning creating a Geronimo EJB defintion matching every J2EE
EJB definition, a Geronimo resource reference matching every J2EE resource
reference, etc.  I think we'd have to actually go out of our way to drop
empty definitions before saving to disk.  Though we also need to figure
out what to do if there are required elements that we can't "guess" -- I
suppose we'll have to drop those before saving if the user doesn't
populate them.

	The nice things about this kind of approach is that you have to 
click a button or whatever to cause the save, and then presumably you get 
to pick the file name.  One of the things that irked me about Orion/OC4J 
was that it would write out whatever it thought your deployment plan ought 
to be in some cryptic location, and use that instead of what you provided.

Aaron

On Fri, 1 Jul 2005, Dain Sundstrom wrote:
> +1 on Matt's idea
> 
> Maybe we should have a stand-alone tool that can generated a default  
> configuration for any given jar.  This code would also be a good  
> starting point for migration tool to come later.
> 
> -dain
> 
> On Jul 1, 2005, at 4:10 PM, Matt Hogstrom wrote:
> 
> > +1
> >
> > That's how WebSphere operates on a "vanillia" ejb-jar.  Makes life  
> > a lot easier.  It only get's tough when you have to do meet-in-the  
> > middle mapping.  What would be even nicer would be to accept an ear  
> > with no deployment information and generate plans with the defaults  
> > like this. So, for instance, if I wanted to deploy xyz.ear with  
> > myejb.jar a deployment plan for the ear would include the OpenEJB  
> > DDs with default values populated.  Then even meet-in-the middle  
> > mapping would be a piece of cake.
> >
> > - Matt
> > ----- Original Message -----
> > From: "Aaron Mulder" <am...@alumni.princeton.edu>
> > To: <de...@geronimo.apache.org>
> > Sent: Friday, July 01, 2005 2:39 PM
> > Subject: CMP Field Mapping Required?
> >
> >
> >
> >> It looks like our intention is that cmp-field-mappings are
> >> required in openejb-jar.xml.  That is, a single schema sequence  
> >> contains
> >> the table name and one or more cmp-field-mappings, which kind of  
> >> implies
> >> that you can't leave out the cmp-field-mappings, though of course  
> >> there's
> >> no way for us to force you (via the schema) to include one for  
> >> each CMP
> >> field in ejb-jar.xml.  Also, we do currently throw a deployment  
> >> error if
> >> you forget a field.
> >>
> >> But I wonder whether this is all necessary.  We could just default
> >> the column name to the CMP field name, so you would only need to  
> >> provide
> >> the mapping if they were different.  Likewise, we could default  
> >> the table
> >> name to the ejb-name and make that optional too.
> >>
> >> What does everyone think about allowing defaults like that?  I
> >> think it would be handy for trivial demos/examples, and unlikely  
> >> to be
> >> used for real apps.  All else being equal, I'm happy to support easy
> >> examples.  But I'm not sure if people feel like explicit  
> >> deployment errors
> >> would be better than using defaults if you try to map everything but
> >> forget one.
> >>
> >> Aaron
> >>
> >>
> >
> 
> 

Re: CMP Field Mapping Required?

Posted by Dain Sundstrom <da...@iq80.com>.
+1 on Matt's idea

Maybe we should have a stand-alone tool that can generated a default  
configuration for any given jar.  This code would also be a good  
starting point for migration tool to come later.

-dain

On Jul 1, 2005, at 4:10 PM, Matt Hogstrom wrote:

> +1
>
> That's how WebSphere operates on a "vanillia" ejb-jar.  Makes life  
> a lot easier.  It only get's tough when you have to do meet-in-the  
> middle mapping.  What would be even nicer would be to accept an ear  
> with no deployment information and generate plans with the defaults  
> like this. So, for instance, if I wanted to deploy xyz.ear with  
> myejb.jar a deployment plan for the ear would include the OpenEJB  
> DDs with default values populated.  Then even meet-in-the middle  
> mapping would be a piece of cake.
>
> - Matt
> ----- Original Message -----
> From: "Aaron Mulder" <am...@alumni.princeton.edu>
> To: <de...@geronimo.apache.org>
> Sent: Friday, July 01, 2005 2:39 PM
> Subject: CMP Field Mapping Required?
>
>
>
>> It looks like our intention is that cmp-field-mappings are
>> required in openejb-jar.xml.  That is, a single schema sequence  
>> contains
>> the table name and one or more cmp-field-mappings, which kind of  
>> implies
>> that you can't leave out the cmp-field-mappings, though of course  
>> there's
>> no way for us to force you (via the schema) to include one for  
>> each CMP
>> field in ejb-jar.xml.  Also, we do currently throw a deployment  
>> error if
>> you forget a field.
>>
>> But I wonder whether this is all necessary.  We could just default
>> the column name to the CMP field name, so you would only need to  
>> provide
>> the mapping if they were different.  Likewise, we could default  
>> the table
>> name to the ejb-name and make that optional too.
>>
>> What does everyone think about allowing defaults like that?  I
>> think it would be handy for trivial demos/examples, and unlikely  
>> to be
>> used for real apps.  All else being equal, I'm happy to support easy
>> examples.  But I'm not sure if people feel like explicit  
>> deployment errors
>> would be better than using defaults if you try to map everything but
>> forget one.
>>
>> Aaron
>>
>>
>


Re: CMP Field Mapping Required?

Posted by Matt Hogstrom <ma...@hogstrom.org>.
+1 

That's how WebSphere operates on a "vanillia" ejb-jar.  Makes life a lot easier.  It only get's tough when you have to do meet-in-the middle mapping.  What would be even nicer would be to accept an ear with no deployment information and generate plans with the defaults like this. So, for instance, if I wanted to deploy xyz.ear with myejb.jar a deployment plan for the ear would include the OpenEJB DDs with default values populated.  Then even meet-in-the middle mapping would be a piece of cake.

- Matt
----- Original Message ----- 
From: "Aaron Mulder" <am...@alumni.princeton.edu>
To: <de...@geronimo.apache.org>
Sent: Friday, July 01, 2005 2:39 PM
Subject: CMP Field Mapping Required?


> It looks like our intention is that cmp-field-mappings are
> required in openejb-jar.xml.  That is, a single schema sequence contains
> the table name and one or more cmp-field-mappings, which kind of implies
> that you can't leave out the cmp-field-mappings, though of course there's
> no way for us to force you (via the schema) to include one for each CMP
> field in ejb-jar.xml.  Also, we do currently throw a deployment error if
> you forget a field.
> 
> But I wonder whether this is all necessary.  We could just default
> the column name to the CMP field name, so you would only need to provide
> the mapping if they were different.  Likewise, we could default the table
> name to the ejb-name and make that optional too.
> 
> What does everyone think about allowing defaults like that?  I
> think it would be handy for trivial demos/examples, and unlikely to be
> used for real apps.  All else being equal, I'm happy to support easy 
> examples.  But I'm not sure if people feel like explicit deployment errors 
> would be better than using defaults if you try to map everything but 
> forget one.
> 
> Aaron
> 
>