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
2
votes
1 answer

How to install and use db4o for Android?

I have to admit that I'm new to Java and Android. db4o seems to be an excellent DB framework to replace SQLite http://developer.db4o.com/Platforms/Java/Android.aspx. I want to use it for my Android application. I don't know how to:…
Viet
  • 17,944
  • 33
  • 103
  • 135
2
votes
5 answers

Problem using LINQ to SQL with one DataContext per atomic action

I have started using Linq to SQL in a (bit DDD like) system which looks (overly simplified) like this: public class SomeEntity // Imagine this is a fully mapped linq2sql class. { public Guid SomeEntityId { get; set; } public AnotherEntity…
hangy
  • 10,765
  • 6
  • 43
  • 63
2
votes
1 answer

Hibernate: Saving parent objects with already existing children(unidirectional)

I want to save/persist an entity(parent) with unique children objects included only by the parent object. Anything works well until a duplicate child appears, here I get following Exception: Caused by:…
2
votes
1 answer

Inheritance JPA 2.1

I got this entities: @Entity @Table(name = "PROCESS_VERSION") public class ProcessVersion implements Serializable { private static final long serialVersionUID = 1L; private static final String SEQ_NAME = "PROCESS_VERSION_id_SEQ"; @Id …
adrian.riobo
  • 495
  • 5
  • 11
2
votes
1 answer

Persisting technology agnostic Java Model: JAXB vs. eCore

Problem Given a technology specific Java Model T, I want to have: a technology agnostic model A to use in my code (i.e. the M in MVC). a persistence mechanism P to store my model A. Approach Currently I have figured out some options: Option…
Waog
  • 7,127
  • 5
  • 25
  • 37
2
votes
1 answer

How can I join 3 entities JPA?

I have 3 entities: Aluno, Turma and Modalidade. Now I need create Matricula, this entity Matricula will contain all ids of Aluno, Turma and Modalidade with others attribute. one Matricula can have one Aluno and can have many Turma and can have many…
FernandoPaiva
  • 4,410
  • 13
  • 59
  • 118
2
votes
2 answers

Write operations are not allowed in read-only mode - Issue while persisting

I have been facing the below error while trying to save the object to database. I tried the solution mentioned here1 and here2 but no good. I was following a tutorial but the only difference is versions of Spring and Hibernate. I am able to persist…
Srivatsa N
  • 2,291
  • 4
  • 21
  • 36
2
votes
3 answers

Storing simulation results in a persistent manner for Python?

Background: I'm running multiple simulations on a set of data. For each session, I'm allocating projects to students. The difference between each session is that I'm randomising the order of the students such that all the students get a shot at…
PizzAzzra
  • 715
  • 13
  • 25
2
votes
1 answer

add a unique constraint for a column only on subclass

i have a superclass that defines a name column: @MappedSuperclass public class SuperClass { @Basic private String name; } there are plenty of concrete @Entity subclasses that extend it, but for one of them i'd like to add a unique constraint…
radai
  • 23,949
  • 10
  • 71
  • 115
2
votes
1 answer

How might you make a Rails test fixture persistent between tests?

I have a good half-dozen fixtures in my Rails test suite - some quite large - that represent static look-up tables in the database. Since their values theoretically don't change, I'd like to save the time of wiping and reloading the tables between…
Teflon Ted
  • 8,696
  • 19
  • 64
  • 78
2
votes
1 answer

Is there any persistance available to a data uri?

I have a very basic data uri: data:text/html, I would like to store the text written in the body when it changes and load it when…
Tony T
  • 442
  • 3
  • 9
2
votes
2 answers

best way to manage a history from both activity and service?

Short version: what is the best practice way to access maintain a history for certain messages from both an activity and from a service? Long version: I have an activity and a service, which both may be running or not. I want to keep a message log…
Michael Schmidt
  • 1,199
  • 4
  • 14
  • 18
2
votes
1 answer

Evicted object still issues updates to the database in Hibernate

I have a problem where I evict an entity, but changes made to it will still change the database. This is part of the method in my DAO. @Entity public class Profile { @Id @GeneratedValue private Long id; @OneToMany(cascade =…
Merchuk Hul
  • 245
  • 1
  • 2
  • 11
2
votes
3 answers

How do you 'save' data to your database in a rails controller?

I am receiving ajax data in a rails controller. my :updatedFunds comes in within the params, and I set the users' dollars column value equal to it's value-- but it isnt persisting! def update_dollars @user = User.find(params[:user_id]) …
GroundBeesAhh
  • 133
  • 1
  • 4
  • 11
2
votes
0 answers

Create unique constrain on multiple nullable columns in Hibernate

I think it is possible (in general) to have a unique constraint on a table columns, but only those that are not null (e.g. I read here https://stackoverflow.com/a/767702/3733425) But is it possible in hibernate? Here I have an entity with 3 fields…
Merchuk Hul
  • 245
  • 1
  • 2
  • 11