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

Symfony2: get the id of the persisted object

I have two entity: User and Person. In the entity User I need the id of the associated person: user_id. When I am creating a new user, I have to create first the person and then the user. In the user, I have to put the id of the corresponding person…
Milos Cuculovic
  • 19,631
  • 51
  • 159
  • 265
37
votes
2 answers

how to write order by and limit query in jpa

Possible Duplicate: Select top 1 result using JPA i wish to fetch top 10 results based on 'totalTradedVolume' filed of my table 'MasterScrip' when i write the following query: Collection sm=null; sm=em.createQuery("select m from…
z22
  • 10,013
  • 17
  • 70
  • 126
36
votes
3 answers

Yesod: Getting a database entity by ID from an Int

I'm new to both Haskell and Yesod, and am trying to build a simple web application that can answer queries from an external API. I have built a parser (using Parsec), that gets me the ID of an entity I want to load as a regular Int value. However, I…
36
votes
8 answers

How to properly pickle sklearn pipeline when using custom transformer

I am trying to pickle a sklearn machine-learning model, and load it in another project. The model is wrapped in pipeline that does feature encoding, scaling etc. The problem starts when i want to use self-written transformers in the pipeline for…
spiral
  • 381
  • 1
  • 3
  • 6
35
votes
5 answers

What is the difference between business class and domain class? What is meant by persistent classes?

What is the difference between business class and domain class? What is meant by persistent classes?
sevugarajan
  • 9,717
  • 12
  • 34
  • 31
34
votes
2 answers

@JoinFormula and @OneToMany definition - poor documentation

I have two questions concerning @JoinFormula and @OneToMany annotations: How can I limit the number of result with @JoinFormula and @OneToMany annotations? How can I define that id in expression author = id refers to Author.id? Author { @Id …
Vojtěch
  • 11,312
  • 31
  • 103
  • 173
34
votes
7 answers

Sharing a persistence unit across components in a .ear file

In a Java EE 6 application where I'm using .ear packaging, I'd like to create a persistence unit that can be accessed from components in different .jar files. However, I'm not sure how to define this persistence unit. With the @PersistenceContext…
bamoida2010
  • 361
  • 1
  • 3
  • 4
34
votes
4 answers

PostgreSQL column type conversion from bigint to bigserial

When I try to change the data type of a column in a table by alter command... alter table temp alter column id type bigserial; I get ERROR: type "bigserial" does not exist How can I change the datatype from bigint to bigserial?
k s l kumar
  • 351
  • 1
  • 3
  • 3
33
votes
6 answers

In javascript, how can I uniquely identify one browser window from another which are under the same cookiedbased sessionId

The users of my web application may have more than one browser window open and pointed to the same page. I would like the state of certain things in the page (loaded via ajax) to be retained across postbacks. I can either store in a cookie or on…
srmark
  • 7,942
  • 13
  • 63
  • 74
33
votes
1 answer

Which provider should be used for the Java Persistence API (JPA) implemenation

I want to use the Java Persistence API (JPA) for my web application. There are popular JPA implementations like Hibernate, Toplink and EclipseLink. What implementation is a good choise and why?
Dimitri Dewaele
  • 10,311
  • 21
  • 80
  • 127
33
votes
10 answers

Why put a DAO layer over a persistence layer (like JDO or Hibernate)

Data Access Objects (DAOs) are a common design pattern, and recommended by Sun. But the earliest examples of Java DAOs interacted directly with relational databases -- they were, in essence, doing object-relational mapping (ORM). Nowadays, I see…
Todd Owen
  • 15,650
  • 7
  • 54
  • 52
32
votes
12 answers

How can I tell if another instance of my program is already running?

How do i tell if one instance of my program is running? I thought I could do this with a data file but it would just be messy :( I want to do this as I only want 1 instance to ever be open at one point.
Arthur
  • 3,376
  • 11
  • 43
  • 70
32
votes
2 answers

Firebase persistence, clear Firebase cache

My app uses Firebase to sync and restore data. I use the setValue:withCompletionBlock: method to insert, update and delete Firebase objects. This method is called whenever there is a CoreData save, thus syncing all my local changes to Firebase -…
31
votes
1 answer

Will multiple calls to `now()` in a single PostgreSQL query always give the same result?

I want to insert one row in a table; e.g.: INSERT INTO some_table VALUES (now(), now()); I want the date value in both the columns to be equal. Is the above query safe for this requirement? Or should I use other alternatives like…
Vikas Prasad
  • 3,163
  • 5
  • 28
  • 39
30
votes
4 answers

JPA Map mapping

How can I map a Map in JPA without using Hibernate's classes?
Rafa de Castro
  • 2,474
  • 1
  • 24
  • 44