persistence

How can I identify a particular computer on my website without cookies (just like Twitter does)?

本秂侑毒 提交于 2019-12-08 01:31:57
问题 I'm looking to identify each computer that accesses my website independent of cookies. I know it can be done because Twitter does it. Here's proof: Reset a browser (no cookies, no cache, total reset) Visit twitter.com Note the value of newly added _twitter_sess cookie Repeat Steps 1 - 3. Cookie _twitter_sess will have the same value as before Change IP addresses Repeat Steps 1 - 3. Cookie _twitter_sess will have the same value as before Change Browsers Repeat Steps 1 - 3. Cookie _twitter_sess

Deployed war to tomcat can't throws java.lang.NoClassDefFoundError: javax/persistence/PersistenceException

为君一笑 提交于 2019-12-07 21:58:11
问题 I'm new to this forum and also new to JPA / EJB. I'm trying to deploy a .war file containing a small application to a tomcat server. The application is using JTA to communicate with the Derby db. When I run and deploy the application from and eclipse top the tomcat server running in eclipse, everything works perfect, but when I export a .war file and try to browse the application it throws an java.lang.ClassNotFoundException: javax.persistence.PersistenceException. My persistence file looks

How to persist a Map<String, List<Object>> in Hibernate

风流意气都作罢 提交于 2019-12-07 17:50:36
问题 I've got a Map containing MyObject instances. The MyObject class uses JPA to persist its fields: @OneToMany(cascade = CascadeType.ALL) @LazyCollection(LazyCollectionOption.FALSE) private Map<String, MyObject> results = new HashMap<String, MyObject>(); We changed the value stored by the Map to a List : private Map<String, List<MyObject>> results = new HashMap<String, List<MyObject>>(); But upon launching we receive a stack trace: Caused by: org.hibernate.AnnotationException: Use of @OneToMany

Entity Framework Not Saving / Stop database being rebuilt

て烟熏妆下的殇ゞ 提交于 2019-12-07 14:51:29
问题 I am teaching myself about the entity framework using a tutorial found at http://msdn.microsoft.com/en-us/data/jj591506. I am working with the code below. using (var db = new DatabaseEntities()) { var section = new Section { SectionID = 1, SectionName = "Bob" }; db.Sections.Add(section); db.SaveChanges(); } For some reason this code is not writing to my database. No error are being thrown. Do you have ideas what I could look at or what could be the cause? This is an almost exact copy of the

JPA Memory Management Issues

筅森魡賤 提交于 2019-12-07 14:12:08
问题 First, a little background. I am working on Management Software that pulls data from an SQL Server. I am using JPA to create Entity instances of the tables for manipulation within the management software (I've only been using JPA for a couple of days now). As a test, I threw together the below code to test how much memory would be taken up storing objects of their most abundant table (PeriodicalTable) which has 18,500 rows (or there abouts) and is only likely to grow; public static void main

JBoss7 + PostgreSQL New missing/unsatisfied dependencies

橙三吉。 提交于 2019-12-07 12:36:50
问题 im migrating a Project from JBoss3 to JBoss7. I just started yesterday and reconfigured my standalone.xml, module.xml and persistence.xml. In the JBoss modules folder, i created the org/postgres/main dir. In this dir i got the new Postgres JDBC41 Driver and my module.xml. This is what i get, if i want to start the JBoss: 14:42:53,697 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report JBAS014775: New missing/unsatisfied dependencies: service jboss.jdbc

how to make openjpa 2.2.0 not persist foreign key

不羁岁月 提交于 2019-12-07 12:19:50
问题 I have two tables.. Asset table ASSET_ID SYSIBM INTEGER 4 0 No USER_ID SYSIBM INTEGER 4 0 No ASSET_TYPE_ID SYSIBM SMALLINT 2 0 No ACCESSIBILITY_ID SYSIBM SMALLINT 2 0 Yes DOWNLOAD_TYPE_ID SYSIBM SMALLINT 2 0 No ASSET_STATUS_ID SYSIBM SMALLINT 2 0 No ASSET_MARKETING_ID SYSIBM SMALLINT 2 0 Yes ASSET_PI_SPI_ID SYSIBM SMALLINT 2 0 Yes and the Accesibility table ACCESSIBILITY_ID SYSIBM SMALLINT 2 0 No ACCESSIBILITY_DESC SYSIBM VARCHAR 50 0 No i have two beans, Asset Bean @Column(name="ASSET_ID")

java.lang.IllegalArgumentException: Named query not found.(Entity Manager not creating NamedQuery)

家住魔仙堡 提交于 2019-12-07 11:56:49
问题 I am using hibernate 4.1.5.Final and Spring 3.1.2 Release and Jboss 7.1 . I have written all named queries in a class with @NamedQuery annotation but entity manager not creating named query . i am posting the stacktrace and context.xml 09:58:49,695 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) java.lang.IllegalArgumentException: Named query not found: validateLoginHash 09:58:49,770 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.hibernate.ejb.AbstractEntityManagerImpl

How can I wrap Play/JPA's Model class with a generic Repository?

久未见 提交于 2019-12-07 11:31:43
问题 I don't like working with models objects directly, because this breaks encapsulation. Instead, I prefer the Repository Pattern. When I try to implement a simple repository public abstract class BaseRepository<T extends Model> { public T findOne(String query, Object... params) { GenericModel.JPAQuery result = T.find(query, params); return result.first(); } } public class UserRepository extends BaseRepository<User>{} UserRepository repo = new UserRepository(); repo.findOne("byUsername", "test")

Spring DaoSupport and @PersistanceContext EntityManager?

懵懂的女人 提交于 2019-12-07 10:13:39
问题 One of the most difficult things about understand Spring is that Spring supports multiple approaches to the same problem. So in my application I using injected EntityManager using the @PersistanceContext annotation, for example: @Repository public class JpaDao extends JpaDaoSupport implements Dao { @PersistenceContext(unitName = "PersistanceUnit", type = PersistenceContextType.EXTENDED) private EntityManager em; Is this approach compatible with extending JpaDaoSupport (which requires