Questions tagged [persistence]

Persistence in computer programming refers to the capability of saving data outside the application memory.

Persistence is the capability of saving data outside of application memory, and of retrieving it later for further processing.

Typically data can be stored into the file system, in flat files or in a database. But persistence can also involve sending data to external applications.

Often persistence is related to .

References.

5099 questions
43
votes
3 answers

Android Room transactions across DAOs

The official documentation states that: It is recommended to have multiple Dao classes in your codebase depending on the tables they touch. and that one can mark a method with the Transaction annotation like that: @Dao public abstract class…
Alessandro
  • 3,666
  • 2
  • 28
  • 41
42
votes
3 answers

Best data persistence for Angularjs/Javascript Apps on PhoneGap?

I am looking to find best practices for Angularjs data persistence on a PhoneGap app. I'm using Ionic Framework on top of this, but not relevant to this question as it is just built on top of Angular & Cordova. I like that Angular remains flexible…
Kevin Baker
  • 1,187
  • 3
  • 12
  • 22
42
votes
5 answers

org.hibernate.AnnotationException: @OneToOne or @ManyToOne on entities.Ques#tion.examId references an unknown entity: long

I'm trying to setup JPA with a hibernate implementation for the first time with this test project. Ran into the following error: Exception in thread "main" javax.persistence.PersistenceException: [PersistenceUnit: ExamModulePu] Unable to build…
41
votes
8 answers

Make persistent changes to init.rc

I want to change the init.rc file of an android pad. But after I change it and reboot the system, the original init.rc comes back. How can I make the change to the init.rc persistently without rebuild the system (since I don't have the source code…
user1278251
  • 411
  • 1
  • 4
  • 5
41
votes
5 answers

Java Persistence: Cast to something the result of Query.getResultList()?

Hey everyone, I'm new to persistence / hibernate and I need your help. Here's the situation. I have a table that contains some stuff. Let's call them Persons. I'd like to get all the entries from the database that are in that table. I have a Person…
GuiSim
  • 7,361
  • 6
  • 40
  • 50
41
votes
7 answers

Easiest way to persist a data structure to a file in python?

Let's say I have something like this: d = { "abc" : [1, 2, 3], "qwerty" : [4,5,6] } What's the easiest way to progammatically get that into a file that I can load from python later? Can I somehow save it as python source (from within a python…
Blorgbeard
  • 101,031
  • 48
  • 228
  • 272
40
votes
3 answers

Does static variables in php persist across the requests?

Static variable gotcha in php I am from Java background and have switched to php for one project recently. I have found one unexpected behaviour in php. Value set to some static variable is not staying persistent across the requests. I am not…
Vaibhav Kamble
  • 3,579
  • 5
  • 23
  • 16
40
votes
3 answers

How to insert images in mongoDB using java?

I want to store image documents in MongoDB. I am using java. Any links or suggestions would be appreciated.
user405398
40
votes
7 answers

What does persistence object means in Hibernate architecture?

Hibernate is a persistence framework which is used to persist data from Java environment to database. I am so confused.. if we persist an object to the database, then why does Hibernate Architecture depicts the persistent object in the middle of…
Mohammad Asgari
  • 663
  • 2
  • 6
  • 12
39
votes
9 answers

Generate JPA 2 Entities from existing Database

How can I generate JPA2 compliant @Entity from existing Databases?. I found this: Question Still its not clear if JBoss will generate compliant JPA2 and also I would like to know if there is a vendor independent way to do this.
will824
  • 2,203
  • 4
  • 27
  • 29
38
votes
2 answers

AnnotationException: A Foreign key refering has the wrong number of column. should be 2

I am mapping my classes with the tables of my database, but when running a test, I get the following error: Caused by: org.hibernate.AnnotationException: A Foreign key refering com.modulos.pvs.acceso.datos.entity.Provincia from…
Elias Vargas
  • 1,126
  • 1
  • 18
  • 32
38
votes
6 answers

Can javascript access a filesystem?

I was pretty sure the answer was NO, and hence google gears, adobe AIR, etc. If I was right, then how does http://tiddlywiki.com work? It is persistent and written in javascript. It is also just a single HTML file that has no external (serverside)…
Joe
  • 5,341
  • 3
  • 19
  • 14
37
votes
6 answers

Is it possible to get gVim to remember window size?

I know how to set the initial window size in gVim, but how do I get it to automatically restore the window dimensions from last session? Is this even possible?
Charles Roper
  • 20,125
  • 20
  • 71
  • 101
37
votes
18 answers

"Type of the parameter must be a class annotated with @Entity" while creating Generic DAO interface in Room

I am using Room architecture component for persistence. I have created generic DAO interface to avoid boilerplate code. Room Pro Tips But my code doesn't compile saying "Error:(21, 19) error: Type of the parameter must be a class annotated with…
xrnd
  • 1,273
  • 3
  • 21
  • 38
37
votes
2 answers

Difference between configuring data source in persistence.xml and in spring configuration files

I've seen (and done) data source configuration in two ways (the code below is just for demo): 1) configuration inside persistence units, like: domain.User
Roman
  • 64,384
  • 92
  • 238
  • 332