Re[2]: [JBoss-user] Mapping of relationships
Hello Alex, Thursday, August 22, 2002, 4:28:14 AM, you wrote: AL> if I understand you right, you let JBossCMP to create and name fields AL> and tables. In this case there is no gaurantee your AL> query will be portable across different servers. AL> To have database schema the same using different app servers you need AL> to name all the fields and tables yourself and configure appropriate AL> DD file ( jbosscmp-jdbc.xml for JBoss ). Equivalent files should be AL> present in other app servers. On the moment I am letting JBoss CMP create name fields and tables. But if this will increse portability I can name them and gerate the DD file for the target application server. If I can map the relationships too in the same way I have no problem. AL> And another issue with dynamic queries. The implementation of dynamic AL> queries may differ form server to server. The following is a WL's AL> code. Compare it to JBoss approach: But note I do not want to use dynamic queries. Just because of that, different approachs. What I want to do is make direct SQL (not EJB-QL) queries to the database. As David Jencks noted this will limit it to work on relational databases but I can accept that. I want this to implement the Value List Handler pattern, so I can make a dynamic query of a large number os record without the overhead of a finder method. AL> InitialContext ic=new InitialContext(); AL> FooHome fh=(FooHome)ic.lookup("fooHome"); AL> QueryHome qh=(QueryHome)fh; AL> Sring ejbql="SELECT OBJECT(e)FROM EmployeeBean e WHERE e.name='rob'" AL> Query query=qh.createQuery(); AL> query.setMaxElements(10) AL> Collection results=query.find(ejbql); DLR>> On another mail Dain Sundstrom says the spec does not say anything DLR>> about mapping of CMR to database tables. -- Best regards, Danilomailto:[EMAIL PROTECTED] --- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re[2]: [JBoss-user] Mapping of relationships
AL> InitialContext ic=new InitialContext(); AL> FooHome fh=(FooHome)ic.lookup("fooHome"); AL> QueryHome qh=(QueryHome)fh; AL> Sring ejbql="SELECT OBJECT(e)FROM EmployeeBean e WHERE e.name='rob'" AL> Query query=qh.createQuery(); AL> query.setMaxElements(10) AL> Collection results=query.find(ejbql); Wow... sorry, it's EJB-QL. I was sleeping ;) -- Best regards, Alex Loubyansky --- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re[2]: [JBoss-user] Mapping of relationships
Hello David, Wednesday, August 21, 2002, 9:41:44 PM, you wrote: DJ> Well, the persistent storage doesn't have to be a relational database: for DJ> instance it could be an object database such as Versant. It also might be DJ> something like SAP, or an xml database. So relationships can't really be DJ> specified by the spec, and you can't rely on any particular representation DJ> if you want your app to be completely portable. Yes, you are right about completly portable. I want this but I know it is difficult so I will be happy if I can port it on JBoss and some popular AppServers (WebLogic and WS) and some databases (Firebird and Oracle). DJ> david jencks DJ> On 2002.08.21 20:27:13 -0400 Danilo Luiz Rheinheimer wrote: >> Hello, >> >> On another mail Dain Sundstrom says the spec does not say anything >> about mapping of CMR to database tables. >> I need on my application the kind of feature of the JBoss DynamicQL. >> But I will not want use it because I do not want use features >> proprietary features, I want my application portable. >> But I need to be able to create sql querys at run time. >> My question is all applications server did the mapping of >> relationships on the same way ? If I have a relationship Order to >> OrderItens (1 - N) in all applications server this will be mapped as a >> Integer field called Order in the table OrderItem ? >> If this happen I can do a "select * from Order, OrderItem where >> Order.Id=OrderItem.Id" and this will work on all applications servers. >> I think the way JBoss maps the relationships is very logic and >> clear. And Dain is not responsible by the implementations of other >> application severs. >> But what you know about that ? Is a good idea make select this way ? >> >> -- >> Best regards, >> Danilo mailto:[EMAIL PROTECTED] >> >> >> >> --- >> This sf.net email is sponsored by: OSDN - Tired of that same old >> cell phone? Get a new here for FREE! >> https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 >> ___ >> JBoss-user mailing list >> [EMAIL PROTECTED] >> https://lists.sourceforge.net/lists/listinfo/jboss-user >> >> DJ> --- DJ> This sf.net email is sponsored by: OSDN - Tired of that same old DJ> cell phone? Get a new here for FREE! DJ> https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 DJ> ___ DJ> JBoss-user mailing list DJ> [EMAIL PROTECTED] DJ> https://lists.sourceforge.net/lists/listinfo/jboss-user -- Best regards, Danilomailto:[EMAIL PROTECTED] --- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Mapping of relationships
Hello Danilo, if I understand you right, you let JBossCMP to create and name fields and tables. In this case there is no gaurantee your query will be portable across different servers. To have database schema the same using different app servers you need to name all the fields and tables yourself and configure appropriate DD file ( jbosscmp-jdbc.xml for JBoss ). Equivalent files should be present in other app servers. But there are other issues. For example, JBossCMP doesn't support exposing primary keys as foreign in relationships (for now). And here sql queries are not portable if another server supports this. And another issue with dynamic queries. The implementation of dynamic queries may differ form server to server. The following is a WL's code. Compare it to JBoss approach: InitialContext ic=new InitialContext(); FooHome fh=(FooHome)ic.lookup("fooHome"); QueryHome qh=(QueryHome)fh; Sring ejbql="SELECT OBJECT(e)FROM EmployeeBean e WHERE e.name='rob'" Query query=qh.createQuery(); query.setMaxElements(10) Collection results=query.find(ejbql); As you see it differs. alex Thursday, August 22, 2002, 3:27:13 AM, you wrote: DLR> Hello, DLR> On another mail Dain Sundstrom says the spec does not say anything DLR> about mapping of CMR to database tables. DLR> I need on my application the kind of feature of the JBoss DynamicQL. DLR> But I will not want use it because I do not want use features DLR> proprietary features, I want my application portable. DLR> But I need to be able to create sql querys at run time. DLR> My question is all applications server did the mapping of DLR> relationships on the same way ? If I have a relationship Order to DLR> OrderItens (1 - N) in all applications server this will be mapped as a DLR> Integer field called Order in the table OrderItem ? DLR> If this happen I can do a "select * from Order, OrderItem where DLR> Order.Id=OrderItem.Id" and this will work on all applications servers. DLR> I think the way JBoss maps the relationships is very logic and DLR> clear. And Dain is not responsible by the implementations of other DLR> application severs. DLR> But what you know about that ? Is a good idea make select this way ? -- Best regards, Alex Loubyansky --- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Mapping of relationships
Well, the persistent storage doesn't have to be a relational database: for instance it could be an object database such as Versant. It also might be something like SAP, or an xml database. So relationships can't really be specified by the spec, and you can't rely on any particular representation if you want your app to be completely portable. david jencks On 2002.08.21 20:27:13 -0400 Danilo Luiz Rheinheimer wrote: > Hello, > > On another mail Dain Sundstrom says the spec does not say anything > about mapping of CMR to database tables. > I need on my application the kind of feature of the JBoss DynamicQL. > But I will not want use it because I do not want use features > proprietary features, I want my application portable. > But I need to be able to create sql querys at run time. > My question is all applications server did the mapping of > relationships on the same way ? If I have a relationship Order to > OrderItens (1 - N) in all applications server this will be mapped as a > Integer field called Order in the table OrderItem ? > If this happen I can do a "select * from Order, OrderItem where > Order.Id=OrderItem.Id" and this will work on all applications servers. > I think the way JBoss maps the relationships is very logic and > clear. And Dain is not responsible by the implementations of other > application severs. > But what you know about that ? Is a good idea make select this way ? > > -- > Best regards, > Danilo mailto:[EMAIL PROTECTED] > > > > --- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user > > --- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Mapping of relationships
Hello, On another mail Dain Sundstrom says the spec does not say anything about mapping of CMR to database tables. I need on my application the kind of feature of the JBoss DynamicQL. But I will not want use it because I do not want use features proprietary features, I want my application portable. But I need to be able to create sql querys at run time. My question is all applications server did the mapping of relationships on the same way ? If I have a relationship Order to OrderItens (1 - N) in all applications server this will be mapped as a Integer field called Order in the table OrderItem ? If this happen I can do a "select * from Order, OrderItem where Order.Id=OrderItem.Id" and this will work on all applications servers. I think the way JBoss maps the relationships is very logic and clear. And Dain is not responsible by the implementations of other application severs. But what you know about that ? Is a good idea make select this way ? -- Best regards, Danilo mailto:[EMAIL PROTECTED] --- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user