You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Tino Schöllhorn <t....@plattform-gmbh.de> on 2005/08/07 15:23:46 UTC

OJB 1.0.x and Java5.0

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: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: OJB 1.0.x and Java5.0

Posted by Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br>.
I'll try that example with OJB...

Thanks,

Edson Richter


Thomas Dudziak escreveu:

>On 8/8/05, Edson Carlos Ericksson Richter
><ed...@mgrinformatica.com.br> 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 List<LoginHour> loginHours;
>>  public void setUsername(String newUsername) {...}
>>  public String getUsername() {...}
>>  public void setPassword(String newPassword) {...}
>>  public Stirng getPassword() {...}
>>  public void setLoginHours(List<LoginHour> loginHours) {
>>    this.loginHours = loginHours;
>>  }
>>  public List<LoginHour> 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: ojb-user-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>
>  
>


-- 
Edson Carlos Ericksson Richter
MGR Informática Ltda.
Fones: 3347-0446 / 9259-2993



Re: OJB 1.0.x and Java5.0

Posted by Thomas Dudziak <to...@gmail.com>.
On 8/8/05, Edson Carlos Ericksson Richter
<ed...@mgrinformatica.com.br> 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 List<LoginHour> loginHours;
>   public void setUsername(String newUsername) {...}
>   public String getUsername() {...}
>   public void setPassword(String newPassword) {...}
>   public Stirng getPassword() {...}
>   public void setLoginHours(List<LoginHour> loginHours) {
>     this.loginHours = loginHours;
>   }
>   public List<LoginHour> 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: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: OJB 1.0.x and Java5.0

Posted by Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br>.
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 List<LoginHour> loginHours;
  public void setUsername(String newUsername) {...}
  public String getUsername() {...}
  public void setPassword(String newPassword) {...}
  public Stirng getPassword() {...}
  public void setLoginHours(List<LoginHour> loginHours) {
    this.loginHours = loginHours;
  }
  public List<LoginHour> 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
><ed...@mgrinformatica.com.br> 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: ojb-user-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>
>  
>


-- 
Edson Carlos Ericksson Richter
MGR Informática Ltda.
Fones: 3347-0446 / 9259-2993



Re: OJB 1.0.x and Java5.0

Posted by Thomas Dudziak <to...@gmail.com>.
On 8/8/05, Edson Carlos Ericksson Richter
<ed...@mgrinformatica.com.br> 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: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: OJB 1.0.x and Java5.0

Posted by Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br>.
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: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>


-- 
Edson Carlos Ericksson Richter
MGR Informática Ltda.
Fones: 3347-0446 / 9259-2993



Re: OJB 1.0.x and Java5.0

Posted by Jason Pyeron <jp...@pdinc.us>.
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: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>

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

Re: OJB 1.0.x and Java5.0

Posted by jys <jy...@fr.st>.
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 <t....@plattform-gmbh.de> 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: ojb-user-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: OJB 1.0.x and Java5.0

Posted by Thomas Dudziak <to...@gmail.com>.
On 8/7/05, Tino Schöllhorn <t....@plattform-gmbh.de> 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: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org