persistence

Hibernate default values during runtime - best practice

Hi stackoverflow coders, I have an app (since the iPhone its really chic to use this word :-)) persisting its data with Hibernate. The database scheme contains several date fields which can be NULL. I configured Hibernate then to fetch the field value also as NULL. The customer wants to configure these values in case these are NULL. So...

Elisp: How to save data in a file?

I want to save data to a file in my elisp program. I have a multi-dimensional list that I want to save to a file, so I can restore it the next time my program runs. What's the easiest / best way to do this? I realise, of course, that I can simply write my data to a buffer in a custom format and then save the buffer, but then I'd have to...

"Persistence provider caller does not implement the EJB3 spec correctly." warning when deploying on JBoss 5.1.0.GA

i get this hibernate warning pretty much every time i deploy a persistence unit on JBoss. its never the cause of any issues, but i was wondering if anyone knows what exactly this means, and can it be fixed/slicenced/worked-around in some way. ...

nHibernate Lazy Load / Proxied Objects - Persistance Problems

[Updated with mapping files] Ran into an issue with a lazy loaded / proxied object being persisted today. It relates to two classes, Invoice and Address. A invoice has an Address property. Both classes are setup to be lazy loaded and all methods are virtual. In the code I do a Invoice.address = HomeCompany.address and I can verify at ...

Properties.Settings.Save() only saves on first call

I have a DataGridView populated with a BindingList. This list gets saved into the Settings file. It saves and loads correctly.. but will only save the first time I call Properties.Settings.Save(). After that, calling Save() will do nothing. I have verified that Save() is being called, and that at the time it's called the BindingList ...

Will NHibernate attempt to save the same object twice in this scenario?

Lets say I have two entities: Stable, and Pony. Stable has an IList<Pony> with a HasMany mapping configured with Cascade.All(). That means that if I do session.Save(myStable), each Pony in the collection will be saved. However, what happens if I do this? Pony myLittlePony = new Pony(Color.Brown); Stable myStable = new Stable(WoodType...

Is it possible to change the default persistence model away from session persistence in Spring.Net?

In Chapter 22 of the Spring.Net documentation (see 22.7.3. Customizing model persistence) at http://www.springframework.net/doc-latest/reference/html/web.html, they discuss changing the model for persisting data. I don't use this functionality, so I have a custom persister that basically performs a noop, but to set it as the default, I...

How to share EntityManagerFactory Object across the various Resource files in a Restlet application?

I would like to create one EMF object and use it in various Resource class objects.. any ideas on how to do this? ...

Windows Workflow Foundation 4 (WF4) Persistence

I've been working with Visual Studio 2010 Beta-2 to get some advanced learning on WF4. Everything was going fine until today, when I un-installed Visual Studio 2010 Beta-2, and installed the Visual Studio 2010 Release Candidate. My code is complaining that it can’t find the System.Runtime.Persistence namespace that I am using, and also,...

Creating a Persistent Data Object In Django

I have a Python-based maximum entropy classifier. It's large, stored as a Pickle, and takes about a minute to unserialize. It's also not thread safe. However, it runs fast and can classify a sample (a simple Python dictionary) in a few milliseconds. I'd like to create a basic Django web app, so users can submit samples to classify in re...

JPA property java.net.URL

HI, I have an object which has a piece of URL-Information associated with it. Currently I save this URL in a simple String property, but java.net.URL would provide me with additional goodies such as detection of malformed URLs etc. On the other hand I would consider it very ugly, if JPA simply created a LOB for the URL-Object. Does an...

Automatically create Entities from database

Is there a way to automatically create javax.persistence.Entity classes from an existing database (or from the SQL statements that created them)? I am just reading through the persistence part of The Java EE 5 Tutorial and creating all these annotations by hand seems rather wasteful considering that all (or most) of the necessary knowle...

how to make data structures persistent in c++?

how to make data structures(like trees, graphs ) persistent in c++? ...

Creating database desktop application with data manipulation in Netbeans using Java Persistence

It's my first time to use Persistence in developing a Java program because I usually connect via JDBC. I read that for large amounts of data, it is best to use persistence. I tried playing with the CRUD example of Netbeans. It's not very helpful thought because it only connects to the DB and allows addition and deletion of records. I nee...

NHibernate Equality: How do I ensure only one row is persisted from many "equal" .NET objects?

How can I get the following test to pass with NHibernate? I thought it was enough to simply override Equals and GetHashCode in the entity class for this to work the way I want it to. Obviously for "Point" objects, which are quite trivial, it's silly to persist multiple rows for identical coordinates. I have two point objects that have i...

What type of data storage should I use if I have a list of data that contains 100 objects and each object has its own data?

My plan is to display a list of items alphabetically in a table view that has about 100 items. Each item has an image, a list of times and a description that the tableview will drill down to. What I am struggling with is the correct way to store and load this data. Some have told me that a plist will be too data heavy and that core da...

How to load a separate Application Settings file dynamically and merge with current settings?

There are questions pertaining to reading settings from a separate config file and others similar to it, but my question is specific to application property settings (i.e. <MyApplication.Properties.Settings> - see XML file below) and how to load them dynamically. I tried the method in this post, which involved refreshing the entire appSe...

Hibernate/Spring: Persisting collections

Hi guys, I've got two objects: User and Permission, where User has a Collection. In my "create" service, I read a bunch of Permissions, put them in a HashSet, add them to the user, and create the user using my DAO that says ((SessionFactory) sessionFactory).getCurrentSession().save(user); When I look in my object, all looks fine, bu...

SPPersistedObject and List<T>

Hi I want sharepoint to "persist" a List of object I wrote a class SPAlert wich inherit from SPPersistedObject : public class SMSAlert: SPPersistedObject { [Persisted] private DateTime _scheduledTime; [Persisted] private Guid _listId; [Persisted] private Guid _siteID; } Then I wrote a...

Stable/repeatable random sort (MySQL, Rails)

I'd like to paginate through a randomly sorted list of ActiveRecord models (rows from MySQL database). However, this randomization needs to persist on a per-session basis, so that other people that visit the website also receive a random, paginate-able list of records. Let's say there are enough entities (tens of thousands) that storin...