persistence

File resource persistence in PHP

对着背影说爱祢 提交于 2019-12-01 06:53:50
问题 I'm developing a simple chat web application based on the MSN protocol. The server communicates with the MSN server through a file resource returned from fsockopen () . The client accesses the server via XMLHttpRequest . The server initially logs in, and prints out the contact list (formatted in an HTML table) which the client receives through the responseText () of the XMLHttpRequest object. Here's the problem. The file resource that is responsible for communication with the MSN server must

Hibernate: getting too many rows

久未见 提交于 2019-12-01 06:36:17
I have problem with getting rows from my database using Hibernate. When I would like to get only one row, I am receiving 20. When I would like to get all of rows from table with about 1.5k rows, I am receiving exactly 15.2k rows. Entity class of this table has composite primary key. This is my code for getting all rows: Criteria criteria = getSession().createCriteria(type); criteria.setCacheable(true).setCacheRegion(BaseEntity.PACKAGE); criteria.list(); And this is my Entity class: @javax.persistence.Entity @Table(name = "my_table") public class My extends MyEntity<MyPK> { @EmbeddedId private

Configuring persistence and orm with JPA 2

十年热恋 提交于 2019-12-01 06:04:59
I'm having some trouble using Persistence on my jBPM project. My configuration is jBPM 5.4 + Hibernate + JPA 2, and I'm currently setting up the process flow to connect to a DB with persistence, through persistence.xml. I'm just trying to connect the default data source (in the H2 server) with my custom persistence.xml, but I keep getting the same error over and over again: Unknown entity: org.jbpm.persistence.processinstance.ProcessInstanceInfo I've manually added to my src/META-INF folder the JBPMorm-JPA2.xml the following content, but the error still persists. Can anyone help me? JBPMorm

eclipselink PersistenceUnitLoadingEception in executable JAR

半世苍凉 提交于 2019-12-01 05:31:32
I am developing a stand-alone java application which uses eclipselink. It is all fine when I execute the app from eclipse IDE. But I've exported an executable JAR file, and since than I can not make eclipseLink work. I have found similar issue in the Eclipse community forum here , but yet not too handy: Please help, My exception is the following: 01 dec. 2010 22:47:31,199 INFO Configuration:97 - Iniciate database Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke

Persistence provider for Java that supports final fields

♀尐吖头ヾ 提交于 2019-12-01 04:18:42
I'm very new to Java but I've been developing a habit to use final wherever possible declaring immutability which i think is a good thing. (Consider f#) I've read that JPA does not support final fields. Hibernate, TopLink? I'm not sure about these but i prefer JPA for now. Is that even possible theoretically - let's say through reflection - to modify final fields after creation? My guess would be... NO :) What would be certainly possible for a persistence solution is to support constructors with parameters. At least i see no reason that would make this impossible. Mapping would be a little

JPA query for getting the whole tree

好久不见. 提交于 2019-12-01 04:10:01
I have a class which models all categories and they can be ordered hierarchically. @Entity @Table(name="categories") public class Category { @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="sequence") @SequenceGenerator(name="sequence", sequenceName="categories_pk_seq", allocationSize=1) @Column(name="id") private Long id; @Column private String name; @OneToOne @JoinColumn(name="idfather") private Category father; } I need to get all categories ordered hierarchically (I mean every father followed by its children and fathers ordered alphabetically on each level) as they could be

Is there a bidirectional multimap persistent data structure?

谁说胖子不能爱 提交于 2019-12-01 04:09:51
In other words, can we model many to many relationships in a persistent data structure efficiently? A pair of unidirectional multimaps was suggested. However, I'm not sure how this would work well for removal in a persistent data structure. Let's take the case where we have keys 1..4 to values "1".."4" and let's say they each refer to all the others, so we have two maps that look very similar for both directions: {1 => ["2","3","4"], 2 => ["1","3","4"], ...} {"1" => [2,3,4], "2" => [1,3,4], ...} Now we want to remove item 1 completely from the system. That requires changing one node in the

Hibernate: getting too many rows

痞子三分冷 提交于 2019-12-01 03:44:41
问题 I have problem with getting rows from my database using Hibernate. When I would like to get only one row, I am receiving 20. When I would like to get all of rows from table with about 1.5k rows, I am receiving exactly 15.2k rows. Entity class of this table has composite primary key. This is my code for getting all rows: Criteria criteria = getSession().createCriteria(type); criteria.setCacheable(true).setCacheRegion(BaseEntity.PACKAGE); criteria.list(); And this is my Entity class: @javax

Is it possible in grails to disable persistence of a domain class?

岁酱吖の 提交于 2019-12-01 03:36:55
问题 To get around this I have to move such classes to src/groovy. It would be nice to have all of my domain model classes in the domains directory rather than split them up. Update 1: This is a popular (look for GRAILS-2515) requested feature on the Grails Jira page. If anyone is interested in this feature you can vote and track it here. Update on GRAILS-2515: static mapWith = "none" should do the trick in 1.3.5. 回答1: It is only possible to mark certain properties on the domain object as

Configuring persistence and orm with JPA 2

梦想与她 提交于 2019-12-01 03:30:32
问题 I'm having some trouble using Persistence on my jBPM project. My configuration is jBPM 5.4 + Hibernate + JPA 2, and I'm currently setting up the process flow to connect to a DB with persistence, through persistence.xml. I'm just trying to connect the default data source (in the H2 server) with my custom persistence.xml, but I keep getting the same error over and over again: Unknown entity: org.jbpm.persistence.processinstance.ProcessInstanceInfo I've manually added to my src/META-INF folder