1

I am using a mobile service of azure.

Example:

I have the ToDoItem class that consists of 4 fields

Id, Text, Complete, State.

In the database in the cloud is only: Id, Text, Complete but the field State does not and at the time of trying to insert a data in the cloud one throws me the error 400: because the column Status is not in the scheme of the table My question is:

How can I ignore the State field when inserting a record?

Juan Tobon
  • 45
  • 7
  • 1
    question is: why did you add you add it to the query? – Stultuske Mar 01 '18 at 13:26
  • Is that the application needs to have a backup of the information that is in the cloud, then at the time of saving some data and does not have internet it saves it in a SQLITE database and that's when the field is used state – Juan Tobon Mar 01 '18 at 13:30
  • You specify column names you are interested in when inserting like - insert into cloud_table (id, text, complete) select id, text, complete from sqlite_table – Ajay Mar 01 '18 at 13:43
  • Yes, the problem is not when saving a data in SQLite, but it is when I try to save it in the Cloud using the Mobile Service – Juan Tobon Mar 01 '18 at 13:50

1 Answers1

2

In JavaEE you can annotate those fields with @Transient annotation. Using @Transient you can have a field which shouldn't persist it.

Check this question: Why does Java have transient fields?

pik4
  • 1,283
  • 3
  • 21
  • 56