Mig-infocom MiG Calendar DBConnect Guide Manual de usuario Pagina 22

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 25
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 21
MiG InfoCom AB
calling PropertyKey.getKey(“myPropertyName”). The key
returned can be used to store any property in any
PropertyConsumer (which both the Activity and Category
classes implement).
When you have stored your value(s) they are as easy as any built in
property to persist. You only have to create a property mapping as
explained above. If the value yo want to store is of a type that is
unknown to DCConnect, such as your own defined classes, those can
be persisted as well and this is explained in the next section.
Persisting your custom data types
To persist a property in the Activity or Category that has a class type
that is a bit more complex than for instance String, Integer or
Long you will have to create your own PropertyMapping sub
class. It is used to convert to and from the custom class type and a
type that is recognized by the database, which normally means
String, Integer or Long.
There are two ways to go about this. Use a String to store the
object in the backing store or to map the custom type to two or more
fields in the backing store (e.g. columns in a database).
Note! It is currently not possible for an Activity or Category to have
the ID object stored in more than one database column. The ID can
be a custom class type but it has to be stored in a single field
(column) in the database. Put in another way, the the primary key of
the record can not be more than one column.
The abstract methods in PropertyMapping are easy to
understand how to implement given the API JavaDoc. Here is a
straight forward implementation of a property mapping that writes and
reads a type MyComplexType that holds two integers.
DBConnect Guide Page 22 / 25
Vista de pagina 21
1 2 ... 17 18 19 20 21 22 23 24 25

Comentarios a estos manuales

Sin comentarios