Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use the Room Persistence Library for Java desktop applications?

Is it possible to use the Room Persistence Library from Google's Android Architecture Components in a java desktop application or in other words – as I haven't found anything on that – which things needed to be done and how complicated would that be?

like image 808
johrpan Avatar asked Apr 02 '18 11:04

johrpan


People also ask

Can I use room with Java?

Room is an ORM, Object Relational Mapping library. In other words, Room will map our database objects to Java objects. Room provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite.

What is room persistence library?

The Room persistence library provides an abstraction layer over SQLite to allow for more robust database access while harnessing the full power of SQLite. Latest Update.

Is room database persistent?

Room is a persistence library that's part of Android Jetpack. Room is an abstraction layer on top of a SQLite database. SQLite uses a specialized language (SQL) to perform database operations.

Is room an ORM?

The room is an ORM ( Object Relational Mapper ) for SQLite database in Android. It is part of the Architecture Components.


1 Answers

No, you can't. When creating a Room database, you need to supply an android Context, but that does not exist outside of android projects. I would suggest trying an ORM like exposed or ktorm instead

like image 56
Nailuj29 Avatar answered Sep 22 '22 13:09

Nailuj29