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 werner <we...@gefi.at> on 2006/02/23 16:08:39 UTC

Anyone using Generics?

Hello!

I lately switched to Java 1.5 and get a lot of warnings like this:

Type safety: The method add(Object) belongs to the raw type List. 
 References to generic type List<E> should be parameterized

I know I can turn off those warnings. But is there a way to use Generics
with OJB (for example for 1:n relations)?

Thanks, Werner

Re: Anyone using Generics?

Posted by werner <we...@gefi.at>.
Well, I'm working on a web application. So I don't care too much about
the warnings. Your solution seems very good to me. Thanks for your help.

Werner

Am Donnerstag, den 23.02.2006, 12:54 -0300 schrieb Edson Carlos
Ericksson Richter:

> I'm just migrating a quite large app (about 300Kloc) to 1.5 and focus is 
> using generics.
> In our case, app was split in several (6) layers, one is specialized in 
> persistence.
> So, we make persistence layer return generyfied collections and add 
> @SuppressWarnings(value={"unchecked"}) on these classes.
> 
> At the rest of application, is mandatory developers could not use 
> @SuppressWarnings - except in real generic code (like window managers 
> capable of deal with Window, JFrame and JInternalFrame transparently).
> 
> For the rest, generics rocks.
> 
> But, if you use OJB code directly inside your GUI, then you'll have to 
> add @SuppressWarnings - I made this question some time ago on this list, 
> and there is no support for generics inside OJB.
> 
> Best regards,
> 
> Richter
> 
> 
> 
> werner escreveu:
> 
> >Hello!
> >
> >I lately switched to Java 1.5 and get a lot of warnings like this:
> >
> >Type safety: The method add(Object) belongs to the raw type List. 
> > References to generic type List<E> should be parameterized
> >
> >I know I can turn off those warnings. But is there a way to use Generics
> >with OJB (for example for 1:n relations)?
> >
> >Thanks, Werner
> >
> >  
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org

Fischer & Masik OEG
GEFi Informationstechnik und Datenservice
Reisenbauerring 5/1/12
A-2351 Wiener Neudorf

Tel: 02236 / 304 224
Fax: 02236 / 304 278
Mobil: 0676 528 97 57

Internet: http://www.gefi.at
e-mail:
persönlich: werner@gefi.at
allgemein: office@gefi.at


*************************
Confidentiality Notice
*************************
The information contained in this Email, and any attachments, is
intended for the named recipients only. It may contain confidential
and/or privileged information. If you are not the intended
recipient, you must not copy, distribute, or take any action in
reliance on it. Any views expressed do not necessarily reflect the
views of the company.

If you receive this Email by mistake, please advise the sender by
using the reply facility in your Email software and then delete it.




Re: Anyone using Generics?

Posted by Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br>.
I'm just migrating a quite large app (about 300Kloc) to 1.5 and focus is 
using generics.
In our case, app was split in several (6) layers, one is specialized in 
persistence.
So, we make persistence layer return generyfied collections and add 
@SuppressWarnings(value={"unchecked"}) on these classes.

At the rest of application, is mandatory developers could not use 
@SuppressWarnings - except in real generic code (like window managers 
capable of deal with Window, JFrame and JInternalFrame transparently).

For the rest, generics rocks.

But, if you use OJB code directly inside your GUI, then you'll have to 
add @SuppressWarnings - I made this question some time ago on this list, 
and there is no support for generics inside OJB.

Best regards,

Richter



werner escreveu:

>Hello!
>
>I lately switched to Java 1.5 and get a lot of warnings like this:
>
>Type safety: The method add(Object) belongs to the raw type List. 
> References to generic type List<E> should be parameterized
>
>I know I can turn off those warnings. But is there a way to use Generics
>with OJB (for example for 1:n relations)?
>
>Thanks, Werner
>
>  
>