persistence

Jboss 7 not Creating Persistence Unit

寵の児 提交于 2019-12-04 15:32:14
I use Jboss 7 , hibernate 4.1.5 FINAL and Spring 3.1.2 for my application Caused by: javax.persistence.PersistenceException: [PersistenceUnit: Virtuoso] Unable to build EntityManagerFactory at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:915) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory

EJB3 and manual hierarchy persistence

我只是一个虾纸丫 提交于 2019-12-04 14:46:02
问题 I have a legacy database, which I am using EJB3 to model. The database is in quite a poor shape, and we have certain unusual restrictions on how we insert into the DB. Now I want to model the database in a hierarchy that fits in with the DB strucuture, but I want to be able to manually insert each entity individually without the persistence manager trying to persist the entities children. I am trying something like the following (boilerplate left out): @Entity @Table(name = "PARENT_TABLE")

Easy way to store and retrieve objects in Java without using a relational DB? [closed]

China☆狼群 提交于 2019-12-04 11:22:11
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 years ago . Do you know of an "easy" way to store and retrieve objects in Java without using a relational DB / ORM like Hibernate ? [ Note that I am not considering serialization as-is for this purpose, as it won't allow to retrieve arbitrary objects in the middle of an object graph. Neither

Does Java have something similar to Cocoa's NSUserDefaults?

六眼飞鱼酱① 提交于 2019-12-04 10:10:51
Mac OS X and iOS have a nice little class called NSUserDefaults . It's a singleton that lets you store strings, arrays, and primitives, and you can always implement some methods to add custom objects to it. It's super useful when you need to store a quick setting without dealing with file manipulations (for example, storing the last picked font name). Does Java have something simple like this? I'd like to be able to store a user's last settings to reload a similar state when the program reloads, but I'm not sure what the best way to do this is in Java. Barry Wark Yes, you can use the java.util

How to cascade persist only new entities

試著忘記壹切 提交于 2019-12-04 09:26:28
I'm having trouble figuring out how to set up JPA persistence (using EclipseLink and transaction-type="RESOURCE_LOCAL") correctly for the following entities: @Entity public class User { // snip various members @ManyToMany private List<Company> companies; public void setCompanies(List<Company> companies) { this.companies = companies; } } @Entity public class Company { // snip various members } What I'm trying to do is set up a cascade for the companies list so that, if a new Company that hasn't been previously persisted is in the list, it would be automatically persisted together with the User:

Java, Code Generation, and Persistence Frameworks

只愿长相守 提交于 2019-12-04 09:11:47
Are there any Java code generation persistence frameworks? Something that is "database first" rather than object model first? I know this is probably heresy in the Java world, I'd just like to know if any frameworks like this exist. I'm more of a .NET guy these days. So on the .NET-side tools like .NET Tiers or CSLA come to mind. sure, hibernate and netbeans for example can reverse engineering a database. You may be want to look at: Hibernate Tools ; site in maintenance netbeans, with recent version of netbeans you can create JPA entities from a JDBC connection My 2 cents. The Apache Cayenne

How can i save the config of my app without using a database??? (using simple textfile)

≯℡__Kan透↙ 提交于 2019-12-04 08:43:28
i need to save a simple field to configurate my APP, cause this, i wont use a database (it's only a field...), i need to save true or false value for this field on a file, and everytimes a section of my app wanna check if it is true they have to check this textfile, and not to open a connexion to a database i need to save the config for ever... i mean that when i exit from my app, and for example, i shut down my android device, when i start my device again and start my app, the config have to be saved is this possible? how can i do it? i can't find any information about that EDIT: i have

Delphi object persistence, what is the best way

独自空忆成欢 提交于 2019-12-04 07:51:50
问题 I have developed application for drawing some shapes (lines mostly) , now i need to be able to store sketch to a file, i know that delphi has build in routines for object persistance, but i have never used it. Can someone tell me can object persistence be used if i have to persist object that have also references to other objects (that will be stored to), i have TLine object wich can be connected to other TLine object etc. Is it better to use this feature or write custom procedure to store

Persisting Custom Objects

淺唱寂寞╮ 提交于 2019-12-04 07:35:18
问题 I have a custom object that simply inherits from NSObject. It has 3 members - two floats and an NSDate . My app is going to have an array with a number of these objects kicking around, and I need to persist it between runs. How can I accomplish this? I've thought about using a SQLite db, but I'm thinking that it's a bit overkill since the only query I'd ever do would be select * . In an ideal world I'd like to use an xml plist file. I'm not sure if I can do this with my custom object though.