0

i want to store an object in an sqlite database:

public class TimeObject {

  long timeBegin;
  long timeEnd;
  long lastBeforePause;
  long lastBeforeClosed;
  int isPaused;
  String timeReadable;
  List<PauseObject> pauses;
}

Basically, storing this isn't a problem at all. But my question is, how do i store the list properly? Would it be reasonable to serialize the list and store it as a TEXT?

This is how a PauseObject looks like:

public class PauseObject {

  long pauseBegin;
  long pauseEnd;
  long pauseLastBeforeClosed;
  String pauseReadable;
}

I'm looking for a way that doesn't affect the performance of the application too much. Any help would be appreciated. Thanks in advance!

1 Answer 1

1

Try ORM Lite http://ormlite.com/sqlite_java_android_orm.shtml

Object Relational Mapping Lite (ORM Lite) provides some lightweight functionality for persisting Java objects to SQL databases while avoiding the complexity and overhead of more standard ORM packages. It supports a number of SQL databases using JDBC and also supports Sqlite with native calls to Android OS database APIs.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.