Is it possible with OrmLite to create a sql script file to easily populate the database with data? I did some searching and couldn't come up with anything easy. I know I can create some objects with data, I'm just looking for a cleaner method.
I'm thinking create a script file, open a a reader at load, and process each file as raw SQL the executeRaw() method. Any thoughts?
Just wanted to post my solution for anyone who might need it
Good one Joe. I think your idea of the
executeRaw()
is close but useupdateRaw()
instead. Update handlesINSERT
,DELETE
, andUPDATE
statements.You should call
TableUtils
to create your schema first of course:Hope this helps. You may want to use the mailing list for questions in the future: