When persisting a class, a persistence solution needs to know how to persist the types of each field in the class. Clearly a persistence solution can only support a finite number of Java types. It cannot know how to persist every possible type creatable. The JDO specifications define lists of types that are required to be supported by all implementations of those specifications. This support can be conveniently split into two parts
JDO requires objects that are PersistenceCapable to be FCO. In addition it supports persisting fields of Interface or java.lang.Object type as FCO (since these are just references to PersistenceCapable objects).
The table below shows the supported SCO java types in JDO2. The table also shows the default-fetch-group (DFG) setting for that Java type (so whether it is retrieved by default when retrieving an object with a field of that type), whether the field is persisted by default (if it is "false" then you would have to add persistence-modifier="persistent" to the field for it to be persisted by JDO), and whether the java type can be used as part of the primary key.
Java Type | DFG? | Persistent? | PK? |
---|---|---|---|
boolean | ![]() |
![]() |
![]() |
byte | ![]() |
![]() |
![]() |
char | ![]() |
![]() |
![]() |
double | ![]() |
![]() |
![]() |
float | ![]() |
![]() |
![]() |
int | ![]() |
![]() |
![]() |
long | ![]() |
![]() |
![]() |
short | ![]() |
![]() |
![]() |
boolean[] | ![]() |
![]() |
![]() |
byte[] | ![]() |
![]() |
![]() |
char[] | ![]() |
![]() |
![]() |
double[] | ![]() |
![]() |
![]() |
float[] | ![]() |
![]() |
![]() |
int[] | ![]() |
![]() |
![]() |
long[] | ![]() |
![]() |
![]() |
short[] | ![]() |
![]() |
![]() |
java.lang.Boolean | ![]() |
![]() |
![]() |
java.lang.Byte | ![]() |
![]() |
![]() |
java.lang.Character | ![]() |
![]() |
![]() |
java.lang.Double | ![]() |
![]() |
![]() |
java.lang.Float | ![]() |
![]() |
![]() |
java.lang.Integer | ![]() |
![]() |
![]() |
java.lang.Long | ![]() |
![]() |
![]() |
java.lang.Short | ![]() |
![]() |
![]() |
java.lang.Boolean[] | ![]() |
![]() |
![]() |
java.lang.Byte[] | ![]() |
![]() |
![]() |
java.lang.Character[] | ![]() |
![]() |
![]() |
java.lang.Double[] | ![]() |
![]() |
![]() |
java.lang.Float[] | ![]() |
![]() |
![]() |
java.lang.Integer[] | ![]() |
![]() |
![]() |
java.lang.Long[] | ![]() |
![]() |
![]() |
java.lang.Short[] | ![]() |
![]() |
![]() |
java.lang.Number | ![]() |
![]() |
![]() |
java.lang.Object | ![]() |
![]() |
![]() |
java.lang.String | ![]() |
![]() |
![]() |
java.lang.String[] | ![]() |
![]() |
![]() |
java.math.BigDecimal | ![]() |
![]() |
![]() |
java.math.BigInteger | ![]() |
![]() |
![]() |
java.math.BigDecimal[] | ![]() |
![]() |
![]() |
java.math.BigInteger[] | ![]() |
![]() |
![]() |
java.sql.Date | ![]() |
![]() |
![]() |
java.sql.Time | ![]() |
![]() |
![]() |
java.sql.Timestamp | ![]() |
![]() |
![]() |
java.util.ArrayList | ![]() |
![]() |
![]() |
java.util.Collection | ![]() |
![]() |
![]() |
java.util.Currency | ![]() |
![]() |
![]() |
java.util.Date | ![]() |
![]() |
![]() |
java.util.Date[] | ![]() |
![]() |
![]() |
java.util.HashMap | ![]() |
![]() |
![]() |
java.util.HashSet | ![]() |
![]() |
![]() |
java.util.Hashtable | ![]() |
![]() |
![]() |
java.util.LinkedHashMap | ![]() |
![]() |
![]() |
java.util.LinkedHashSet | ![]() |
![]() |
![]() |
java.util.LinkedList | ![]() |
![]() |
![]() |
java.util.List | ![]() |
![]() |
![]() |
java.util.Locale | ![]() |
![]() |
![]() |
java.util.Locale[] | ![]() |
![]() |
![]() |
java.util.Map | ![]() |
![]() |
![]() |
java.util.Set | ![]() |
![]() |
![]() |
java.util.TreeMap | ![]() |
![]() |
![]() |
java.util.TreeSet | ![]() |
![]() |
![]() |
java.util.Vector | ![]() |
![]() |
![]() |
java.io.Serializable | ![]() |
![]() |
![]() |
javax.jdo.spi.PersistenceCapable | ![]() |
![]() |
![]() |
javax.jdo.spi.PersistenceCapable[] | ![]() |
![]() |
![]() |
java.lang.Enum | ![]() |
![]() |
![]() |
java.lang.Enum[] | ![]() |
![]() |
![]() |