persist

What do you do with a one-off piece of data that needs to be persisted?

Recently I've been requested to add on something for the administrator of a site where he can 'feature' something. For this discussion let's say it's a 'featured article'. So naturally we already have a database model of 'articles' and it has ~20 columns as it is so I really do not feel like bloating it anymore than it already is. My ...

Remote Seam Persistence

Hi. I have a button in a .xhtml file which calls a javascript function which calls a java function remotely (in jboss seam environment). That java function has an entityManager.persist(object). Do you know why this line of code doesn't commit to the DB? It says something that a transaction hasn't started. I supose in a remote context i d...

JPA EntityManager: Why use persist() over merge()?

EntityManager.merge() can insert new objects and update existing ones. Why would one want to use persist() (which can only create new objects)? ...

JPA - saving changes without persist() invoked

Hi, we are using Toplink implementation of JPA + Spring + EJB. In one of our EJBs we have something like this: public void updateUser(long userId, String newName){ User u = em.get(User.class, userId); u.setName(newName); // no persist is invoked here } So, basically this updateUser method is supposed to update the name of...

How can I remove an item from a Hashmap in Hibernate ?

Hello, I try to delete an item from a hash map with hibernate. Here is my config on the collection: @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) @OneToMany(mappedBy = "game", cascade = CascadeType.ALL, fetch = FetchType.LAZY) @Where(clause = "charactType='charact'") @MapKey(name = "shortcut") @Cascade(org.hibernate.annotations....

EntityManager merge/persist problem

I'm having this strange problem where my merge() or my persist() functions are not being reflected in the database. My JdbcProductDao.java: @Repository("productDao") public class JdbcProductDao implements ProductDao { @PersistenceContext private EntityManager entityManager; public JdbcProductDao(){ } public Produc...

iphone Settings application persist data

In my app I'm using an NSUserDefaults object to store the username, password and server URL in the built-in Settings app. If there is no data saved, the user is presented a login interface and upon succesful login the username and password are saved. Then in my app I have a view which displays this information, but the text is missing as...

How can a checkmark state be saved in core data?

Hello all, I have a list app where users hit the + button and enter in an item that they want to appear in the list and hit save. The table is saved with core data. The only problem is when the cell is taped I want a checkmark to be displayed. Ive enabled multiple selection with UITableViewCell *thisCell = [tableView cellForRowAtIndexP...

Any way to pre populate core data?

Hi all, ive been creating a list app and backing it with core data. I would like to have a default list of say 10 airport items so that the user doesnt have to start from scratch. Is there any way to do this? Any help is appreciated. Thanks in advance. ...

Fictitious jQuery persist method

Is there a way to have a declaration such as the following persist to all matching elements that are later added to the DOM? $("a.my-class").replaceWith("<span>Replaced</span>"); Something along the lines of... $("a.my-class").persist().replaceWith("<span>Replaced</span>"); (Persist is a fictitious method, that I hope conveys what ...

How to persist in order

I have two entities: EXAM and EXAM_NORMAL. EXAM @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Long id; private String name; private String codeName; @Enumerated(EnumType.STRING) private ExamType examType; @ManyToOne private Category category; @OneToMany(mappedBy="id",cascade=CascadeTy...

NHibernate IUserType convert nullable DateTime to DB not-null value

I have legacy DB that store dates that means no-date as 9999-21-31, The column Till_Date is of type DateTime not-null="true". in the application i want to build persisted class that represent no-date as null, So i used nullable DateTime in C# //public DateTime? TillDate {get; set; } I created IUserType that knows to convert the entity ...

asp.net mvc cookies not persisting on local server (aspnetserve)

Hi. Trying to run an MVC app on the 'portable' web server. Software is aspnetserve. (http://www.ohloh.net/p/aspNETserve) Cookies do not persist. They do fine when I run from visual studio debug. Code is fine, seemingly. Only are dead (fail to persist from page to page) when I use this server. My solution requires deploying a portabl...

How to persist a very abstract data type between sessions: PHP

I have an abstract data type that behaves much like stack. It represents a history of "graph objects" made by a particular user. Each "graph object" holds one or more "lines", a date range, keys, and a title. Each "line" holds a sql generator configured for a particular subset of data in my db. I would like for these "histories" to b...

I would like to have a persistent options menu.

I am looking for a way to have the options menu persist on screen after the menu button press until the menu is dismissed by one of the menu choices. ...

Storing a jpa entity where only the timestamp changes results in updates rather than inserts (desired).

I have a JPA entity that stores a fk id, a boolean and a timestamp: @Entity public class ChannelInUse implements Serializable { @Id @GeneratedValue private Long id; @ManyToOne @JoinColumn(nullable = false) private Channel channel; private boolean inUse = false; @Temporal(TemporalType.TIMESTAMP) private Date inUseAt = n...

Problems persisting Core Data structures on iPhone/iPad

I have an iPhone/iPad app using Core Data to keep my application data. Sometimes, even though I don't get any error messages, the data is not really saved so when the app starts anew, it's all gone. This problem seems to disappear after physically rebooting the device, but otherwise it's pretty random and hard to track. Has anyone seen a...

How to persist objects between requests in PHP

I've been using rails, merb, django and asp.net mvc applications in the past. What they have common (that is relevant to the question) is that they have code that sets up the framework. This usually means creating objects and state that is persisted until the web server is recycled (like setting up routing, or checking which controllers ...

C# text file to store data

I want to persist some data into a text file in my c# application. I added the text file to the root of my project. How do i access it now? Will this file be embedded with my exe or what? ...

how to persist some values in outlook vba

As part of what i am doing i need to access varaiables even after the session with the outllok is closed is there any way to persist value ...