0

I'm trying to use a generated class (generated using the Google App Engine) in my Android application through ORMLite. I've created a config file as follows:

# --table-start--
dataClass=com.name.app.entities.customerendpoint.model.Customer
tableName=customer
# --table-fields-start--
# --field-start--
fieldName=key
generatedId=false
# --field-end--
# --field-start--
fieldName=firstName
#columnName=lastClickDate
# --field-end--
# --field-start--
fieldName=lastName
#indexName=clickcount_name_idx
# --field-end--
# --field-start--
fieldName=email
# --field-end--
# --field-start--
fieldName=postcode
# --field-end--
# --field-start--
fieldName=birthDate
dataType=DataType.SERIALIZABLE
#foreign=true
# --field-end--
# --field-start--
fieldName=gender
# --field-end--
# --field-start--
fieldName=facebookId
# --field-end--
# --field-start--
fieldName=googleId
# --field-end--
# --field-start--
fieldName=pictureUrl
# --field-end--
# --field-start--
fieldName=verificationCode
# --field-end--
# --table-fields-end--
# --table-end--
#################################

In the constructor of my DBHelper I'm referring to this file:
super(context, "APP", null, 1, R.raw.ormlite_config);

Unfortenately, when I'm creating the table an SQLException is raised:

java.sql.SQLException: ORMLite can't store unknown class class com.google.api.client.util.DateTime for field 'birthDate'. Serializable fields must specify dataType=DataType.SERIALIZABLE

The weird thing is I definitely specified the birthDate field to be Serializable:

fieldName=birthDate
dataType=DataType.SERIALIZABLE

Does anyone have a clue what I'm doing wrong or is it a bug in ORMLite?

GieJay
  • 152
  • 1
  • 11
  • Here are similar problems:http://stackoverflow.com/questions/14862372/ormlite-datatype-datatype-serializable-doesnt-work and http://stackoverflow.com/questions/10186705/android-ormlite-java-sql-timestamp – Goca Aug 15 '13 at 18:00
  • I've already read those problems before posting mine but those questions involve annotations, they just forgot to set the datatype. I'm not using annotations and I didn't forget to set the datatype. – GieJay Aug 15 '13 at 18:10

1 Answers1

1

You need to persist datatype by dataPersister=SERIALIZABLE, instead dataType=DataType.SERIALIZABLE in your config file.

Thirumalai murugan
  • 5,698
  • 8
  • 32
  • 54
uskysd
  • 103
  • 1
  • 8