Re: OJB 1.0.x and Java5.0
Anyone has an example about how could OJB be used with Generics? This will not affect the class-mapping descriptor? Richter Tino Schöllhorn escreveu: Hi, we are currently thinking of moving from JDK1.4.2 to Java 5.0.x. The most interesting part of new Java Editition is the use of Generics which will lead to a much better understandable code-base. I have a few questions, which might be answered by someone of the OJB community: - Are there any known issues of using OJB 1.0.x with Java 5.0? - If so, will OJB 1.1 work with Java 5.0? - Does anyone use Java 5.0 in a production system? Perhaps someone already has expierience with Java 5.0 and OJB and can share this information. With regards Tino - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Edson Carlos Ericksson Richter MGR Informática Ltda. Fones: 3347-0446 / 9259-2993 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB 1.0.x and Java5.0
On 8/8/05, Edson Carlos Ericksson Richter [EMAIL PROTECTED] wrote: Anyone has an example about how could OJB be used with Generics? This will not affect the class-mapping descriptor? Since Java generics will be compiled to non-generic bytecode, it does not really affect classloading etc. Hence it should not matter when running OJB, you simply specify the collection-descriptor etc. as you would for non-generic code. The only differences are that OJB does not (yet) support enums, and that the XDoclet module might not work with generic code (you'll at least need a CVS build of the XDoclet code to be able to parse 1.5 code). Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB 1.0.x and Java5.0
Let me expand my idea (sorry if I get boring). I have a User object. Each user has a LoginHour list. So, using JDK 5.0 could I declare public class User { private String username; private String password; private ListLoginHour loginHours; public void setUsername(String newUsername) {...} public String getUsername() {...} public void setPassword(String newPassword) {...} public Stirng getPassword() {...} public void setLoginHours(ListLoginHour loginHours) { this.loginHours = loginHours; } public ListLoginHour getLoginHours() { return this.loginHours; } } And this will work fine? There is nothing to be changed on class-descriptor, neihter in collection-descriptor? TIA, Edson Richter Thomas Dudziak escreveu: On 8/8/05, Edson Carlos Ericksson Richter [EMAIL PROTECTED] wrote: Anyone has an example about how could OJB be used with Generics? This will not affect the class-mapping descriptor? Since Java generics will be compiled to non-generic bytecode, it does not really affect classloading etc. Hence it should not matter when running OJB, you simply specify the collection-descriptor etc. as you would for non-generic code. The only differences are that OJB does not (yet) support enums, and that the XDoclet module might not work with generic code (you'll at least need a CVS build of the XDoclet code to be able to parse 1.5 code). Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Edson Carlos Ericksson Richter MGR Informática Ltda. Fones: 3347-0446 / 9259-2993 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB 1.0.x and Java5.0
On 8/8/05, Edson Carlos Ericksson Richter [EMAIL PROTECTED] wrote: Let me expand my idea (sorry if I get boring). I have a User object. Each user has a LoginHour list. So, using JDK 5.0 could I declare public class User { private String username; private String password; private ListLoginHour loginHours; public void setUsername(String newUsername) {...} public String getUsername() {...} public void setPassword(String newPassword) {...} public Stirng getPassword() {...} public void setLoginHours(ListLoginHour loginHours) { this.loginHours = loginHours; } public ListLoginHour getLoginHours() { return this.loginHours; } } And this will work fine? There is nothing to be changed on class-descriptor, neihter in collection-descriptor? I havn't tried but I think not as the generated bytecode (.class files) will have a plain List in there and the compiler has inserted casts in the appropriate places. You can see for yourself what the compiler generates when you print some info via the java.lang.reflect package for your class, you'll see that there isn't any generic stuff in there. Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB 1.0.x and Java5.0
I'll try that example with OJB... Thanks, Edson Richter Thomas Dudziak escreveu: On 8/8/05, Edson Carlos Ericksson Richter [EMAIL PROTECTED] wrote: Let me expand my idea (sorry if I get boring). I have a User object. Each user has a LoginHour list. So, using JDK 5.0 could I declare public class User { private String username; private String password; private ListLoginHour loginHours; public void setUsername(String newUsername) {...} public String getUsername() {...} public void setPassword(String newPassword) {...} public Stirng getPassword() {...} public void setLoginHours(ListLoginHour loginHours) { this.loginHours = loginHours; } public ListLoginHour getLoginHours() { return this.loginHours; } } And this will work fine? There is nothing to be changed on class-descriptor, neihter in collection-descriptor? I havn't tried but I think not as the generated bytecode (.class files) will have a plain List in there and the compiler has inserted casts in the appropriate places. You can see for yourself what the compiler generates when you print some info via the java.lang.reflect package for your class, you'll see that there isn't any generic stuff in there. Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Edson Carlos Ericksson Richter MGR Informática Ltda. Fones: 3347-0446 / 9259-2993 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OJB 1.0.x and Java5.0
Just to confirm, what you are doing works without issue. We are currently doing in production exactly what you are asking here. As Thomas states, due to erasure, the same types are being placed into your persistent objects. As for mutating OJB to use generics -- there really isn't much benefit that can be derived. Almost none of the PB-API methods pass in a class object to specifiy the type (it is inside a Identity, or a Query), it cannot used to specifiy a typed Collection. It's actually kind of nice -- we have a wrapper API around OJB that takes in a critieria and spits back out a collection, and with generics we are now able to 'type' it. So, what use to look like this: List l = ps.findCollectionByCriteria(Foo.class, crit); Iterator it = l.iterator; while (it.hasNext(){ Foo foo = (Foo)it.next(); foo.bar(); } With typed generics, and class attributes now looks like this: for (Foo foo: ps.findCollecionByCriteria(Foo.class, crit)){ foo.bar(); } Our API decleration for this method looks like this: public T extends BusinessObject ListT findCollectionByCriteria(ClassT clazz, Criteria crit); While there isn't as much stuff that can be done with OJB itself, it sure made our wrapper classes nicer. -Andrew -Original Message- From: Edson Carlos Ericksson Richter [mailto:[EMAIL PROTECTED] Sent: Monday, August 08, 2005 3:14 PM To: OJB Users List Subject: Re: OJB 1.0.x and Java5.0 Let me expand my idea (sorry if I get boring). I have a User object. Each user has a LoginHour list. So, using JDK 5.0 could I declare public class User { private String username; private String password; private ListLoginHour loginHours; public void setUsername(String newUsername) {...} public String getUsername() {...} public void setPassword(String newPassword) {...} public Stirng getPassword() {...} public void setLoginHours(ListLoginHour loginHours) { this.loginHours = loginHours; } public ListLoginHour getLoginHours() { return this.loginHours; } } And this will work fine? There is nothing to be changed on class-descriptor, neihter in collection-descriptor? TIA, Edson Richter Thomas Dudziak escreveu: On 8/8/05, Edson Carlos Ericksson Richter [EMAIL PROTECTED] wrote: Anyone has an example about how could OJB be used with Generics? This will not affect the class-mapping descriptor? Since Java generics will be compiled to non-generic bytecode, it does not really affect classloading etc. Hence it should not matter when running OJB, you simply specify the collection-descriptor etc. as you would for non-generic code. The only differences are that OJB does not (yet) support enums, and that the XDoclet module might not work with generic code (you'll at least need a CVS build of the XDoclet code to be able to parse 1.5 code). Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Edson Carlos Ericksson Richter MGR Informática Ltda. Fones: 3347-0446 / 9259-2993 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB 1.0.x and Java5.0
Yes we use Java 5.0 in our Crisfield product, but we have not migrated our OJB projects to it yet. On Sun, 7 Aug 2005, [ISO-8859-1] Tino Schöllhorn wrote: Hi, we are currently thinking of moving from JDK1.4.2 to Java 5.0.x. The most interesting part of new Java Editition is the use of Generics which will lead to a much better understandable code-base. I have a few questions, which might be answered by someone of the OJB community: - Are there any known issues of using OJB 1.0.x with Java 5.0? - If so, will OJB 1.1 work with Java 5.0? - Does anyone use Java 5.0 in a production system? Perhaps someone already has expierience with Java 5.0 and OJB and can share this information. With regards Tino - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Partner Sr. Manager 7 West 24th Street #100 - - +1 (443) 921-0381 Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, purge the message from your system and notify the sender immediately. Any other use of the email by you is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB 1.0.x and Java5.0
On 8/7/05, Tino Schöllhorn [EMAIL PROTECTED] wrote: we are currently thinking of moving from JDK1.4.2 to Java 5.0.x. The most interesting part of new Java Editition is the use of Generics which will lead to a much better understandable code-base. I have a few questions, which might be answered by someone of the OJB community: - Are there any known issues of using OJB 1.0.x with Java 5.0? - If so, will OJB 1.1 work with Java 5.0? - Does anyone use Java 5.0 in a production system? AFAIK it does. In one of our projects we use Java5 as the development JDK (though the deployment platform is JDK 1.4.2), and it works without problems. I think that even generics work as they are compiled to normal generic-less bytecode anyway. I haven't tried them though. The only other Java5 feature that is relevant to OJB - enums - does not work yet. It might be easy but nobody has found the time to investigate yet. Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB 1.0.x and Java5.0
I'am using OJB with java 5, and haven't noticed any issues with it, because of runtime type erasure i guess. Except for the xdoclet module that was patched i think to be able to parse Java 5 classes. Jean-Yves Thomas Dudziak wrote: On 8/7/05, Tino Schöllhorn [EMAIL PROTECTED] wrote: we are currently thinking of moving from JDK1.4.2 to Java 5.0.x. The most interesting part of new Java Editition is the use of Generics which will lead to a much better understandable code-base. I have a few questions, which might be answered by someone of the OJB community: - Are there any known issues of using OJB 1.0.x with Java 5.0? - If so, will OJB 1.1 work with Java 5.0? - Does anyone use Java 5.0 in a production system? AFAIK it does. In one of our projects we use Java5 as the development JDK (though the deployment platform is JDK 1.4.2), and it works without problems. I think that even generics work as they are compiled to normal generic-less bytecode anyway. I haven't tried them though. The only other Java5 feature that is relevant to OJB - enums - does not work yet. It might be easy but nobody has found the time to investigate yet. Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]