users@glassfish.java.net

Generics and EJB3 Entity Beans

From: Behrang Saeedzadeh <behrangsa_at_gmail.com>
Date: Tue, 14 Nov 2006 06:40:27 +0330

Hi,

Can we use Generics when designing EJB3 Entity Beans? Say something like this:

public abstract class Field<Type> {
...
}

@Entity
public class StringField extends Field<String> {
...
}

or

@Entity
public class Form {

   public List<Field> getFields() {
      ...
   }

}

Form f = new Form();
f.add(new StringField());
f.add(new IntegerField());
...

Thanks in advance,
Behi

-- 
"Science is a differential equation. Religion is a boundary condition"
- Alan Turing
Behrang Saeedzadeh
http://www.jroller.com/page/behrangsa
http://my.opera.com/behrangsa