persistence

JPA EntityManger preforming a database insert on merge?

I am using JPA with Hibernate underneath, and I am having trouble getting merge to work, but before I describe the problems I am encountering with JPA, let me lay out what I am trying to accomplish, just in case my problems stems from my approach. I have data from on system that I need to place into another system. To do this I am read...

Hibernate: "Field 'id' doesn't have a default value"

Hi, all. I'm facing what I think is a simple problem with Hibernate, but can't get over it (Hibernate forums being unreachable certainly doesn't help). I have a simple class I'd like to persist, but keep getting: SEVERE: Field 'id' doesn't have a default value Exception in thread "main" org.hibernate.exception.GenericJDBCException: cou...

ORM framework/architecture which supports converting class definitions to dataset definitions in .NET

As part of a system which I am developing I need a method of taking a set of class definitions which define an object model and constructing a dataset from them which can then be populated by instantiating instances of the classes (either singletons or through collections for multiple table rows). The kind of approach I had in mind woul...

Why would you "store instances of the class in the database as entities"?

I'm trying to understand a line from the Google Datastore API which says: JDO uses annotations on Java classes to describe how instances of the class are stored in the datastore as entities, and how entities are recreated as instances when retrieved from the datastore. I'm sure this is a very basic question for most peopl...

Setting a JPA timestamp column to be generated by the database?

In my SQL Server 2000 database, I have a timestamp (in function not in data type) column of type datetime named lastTouched set to (getdate()) as its default value/binding. I am using the Netbeans 6.5 generated JPA entity classes, and have this in my code @Basic(optional = false) @Column(name = "LastTouched") @Temporal(TemporalType.TIM...

SQLite Alternatives for C++

I am developing a application that needs to store data with many writes and reads as requiring fast searching of data (the need for indexes of some sort), and also be able to serialize and save the data. Currently I am thinking about using SQLite, which gets the job done, but I am open for alternatives. The SQLite's syntax really doesn...

Design - how do i handle events on persisted objects as they change state?

Maybe a silly question this, but I'm a rookie developer. Lets say, in a data-driven CRM'ish application, I have a customer type that can go through a number of phases - i.e. phases 1 - 5. As a customer changes phase - events should trigger. Example - as a customer enters phase 3 from phase 2, an email is sent, some lists are updated an...

Persisting user preferences in Silverlight...

I am working on a Silverlight client and associated ASP.NET web services (not WCF), and I need to implement some features containing user preferences such as a "favourite items" system and whether they'd like word-wrapping or not. In order to make a pleasant (rather than infuriating) user experience, I want to persist these settings acro...

What do REFRESH and MERGE mean in terms of databases?

Hi all. I'm curious and need to find this answer quick. Google won't help much. The Java Persistece API has these properties that tell the framework to cascade operations on associated entities: CascadeType.PERSIST CascadeType.DELETE CascadeType.MERGE CascadeType.REFRESH I know what the first two mean: when I persist object A which h...

Jpa or Hibernate for Java Persistence?

I'm researching the development of Enterprise Applications in Java, .NET and Groovy. For each platform, we're going to try how hard it is to realize a simple SOAP web service. We'll use the tools and libraries that are most commonly used, to research the real world as accurately as possible. In this regard, would it be best to use the n...

JPA Map<String,String> mapping

How can I map a Map in JPA without using Hibernate's classes? Thanks in advance. ...

Updating and persisting dataset problem

I think I'm missing sth. trivial here : I want to update a dataset and push it back to the database where it came from, but I am keep getting a : Concurrency violation: the UpdateCommand affected 0 of the expected 1 records. Here's some code producing this error : public static void UpdateNorthWindWithDataset() { stri...

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 in things in the page (loaded via ajax) to be retained across postbacks. I can either store in a cookie or on my server. Either way, I can't think of how I can distinguish each window. For example...

Old data stored in database file

How can I ensure that all data that I've erase from the db tables, is no longer stored in the mdb files (and others) on the hard disk? Here's my situation: My client used to store non-encrypted credit card data, in their database (SQL Server). Thanks to PCI requirements, they now encrypt all that data... However, the mdb file still has ...

Is it possible to generate JPA entity classes from a database schema at runtime?

IDEs like Netbeans allow generation of entity classes through a persistence context. If you had access to underlying generation method (not sure if it is an external tool or part of the IDE), could you generate database entity classes dynamically at runtime? The idea being that you could hook into the entity classes using reflection. I ...

Light-weight flexible data persistence options

I was originally using SQLCE first starting with LINQ to SQL and then moved to Entity Framework, but it seems that SQLCE is too inflexible. (Right now I can't even drop a table to recreate it because it says I can't remove PrimaryKeyA because it is being referenced by PrimaryKeyA... so I don't have much confidence in being able to modif...

Entity Framework won't persist data in SQL Express (MDF)

Hi guyz, I'm going crazy abou this, because I can't see what I'm doing wrong!!! Please help me!!! I was developing a application using Entity Framework and storing data in a .mdf database, my code can read the data, apparently it can save too, but only apparently. I get no erros, while the program is running it act like the data was sav...

How can I get information out of a junction table using JPA/EclipseLink?

I have the following many-to-many mapping: public class Student implements { @Id @GeneratedValue private Integer xID; @ManyToMany @JoinTable(name = "x_y", joinColumns = { @JoinColumn(name = "xID")}, inverseJoinColumns={@JoinColumn(name="yID")}) private Set<Cat> cats; } public class Cat implements { @Id ...

Advice on High Score persistence (iPhone, Cocoa Touch)

Hi. I was curious what is considered the better way to manage the reading and writing of a High Score plist file. My High Score class is: @interface HighScore : NSObject <NSCoding> { NSString *name; int score; int level; int round; NSDate *date; } Now, I could do method A, add NSCoding methods: - (vo...

What do they mean by persistence in nHibernate?

Hi, What does the term persistence mean when dealing with nHibernate? What exactly is persistent? ...