class « Update « JPA Q&A





1. can I tell Hibernate a class is immutable so it will share the objects to save cost of construction?    stackoverflow.com

I have some classes that represent immutable objects (Quantity, Price, Probability). Is there some way to tell Hibernate that the objects will never change so it can re-use objects rather ...

2. Replace a hibernate persisted class with its sibling class    stackoverflow.com

I'm working on a project using Hibernate to persist my entities (the full stack includes struts2, spring, jpa & hibernate). I have two classes List and Pie, and both inherit from a ...

3. Persisting a class to two tables with Hibernate    coderanch.com

Hello Ranchers, I have 2 tables, named items and item_types (a lookup table), in which Ive included the SQL DDL. I want to map them to a class defined below. Ive included the mapping Ive used which works great for querying the data. However, Id like to save the data as well. I couldnt figure out how to make Hibernate aware ...

4. Persist nested classes    forum.hibernate.org

Hi, I am new to Hibernate. I have nested classes like Class AA Class BB Class CC With hibernate mappings is it possible to persist Class AA and Class CC only. I have no need for Class BB. I only need BB to traverse from AA to CC. Any help would be really appreciated. Thanks,

5. [solved] persistent class not known: long    forum.hibernate.org

org.hibernate.MappingException: persistent class not known: long at org.hibernate.cfg.Configuration$1.getIdentifierType(Configuration.java:2109) at org.hibernate.type.EntityType.getIdentifierType(EntityType.java:487) at org.hibernate.type.EntityType.getIdentifierOrUniqueKeyType(EntityType.java:512) at org.hibernate.persister.entity.AbstractPropertyMapping.initIdentifierPropertyPaths(AbstractPropertyMapping.java:169) at org.hibernate.persister.entity.AbstractPropertyMapping.initPropertyPaths(AbstractPropertyMapping.java:159) at org.hibernate.persister.entity.AbstractEntityPersister.initOrdinaryPropertyPaths(AbstractEntityPersister.java:1712) at org.hibernate.persister.entity.AbstractEntityPersister.initPropertyPaths(AbstractEntityPersister.java:1742) at ...

6. hibernate 3.5.x update and IdentifierGeneratorFactory.class    forum.hibernate.org

Newbie Joined: Tue Jul 06, 2010 5:26 pm Posts: 1 I am trying to update to hibernate 3.5.3 with spring 3.0.2 One issue I am having is that the IdentifierGeneratorFactory.class has changed in the hibernate-core jar. Looks as if the the class was moved into a factory package. The getGeneratedIdentity() method isn't there anymore. We were using IdentifierGeneratorFactory.getGeneratedIdentity() is retrieve the ...

7. Problem persisting a class with hibernate    forum.hibernate.org

Hello, I have a class Person that i want to persist via hibernate. The class has several attributes like name, firstname, and so on. Code: @Entity @Table(name = "PERSON") public class Person { /** * serial id */ private static final long serialVersionUID = 8924573169941152854L; ...

8. Updating java classes    forum.hibernate.org

Hello There is some question connected with the automatic update of java classes. For example I have mapping of 3 classes (+ 3 hbm.xml files for this classes) and somebody creates a new table in DB. Is there some automatically way to say to hibernate (in option or by other way) to create the fourth class and fourth hbm.xml file in ...

9. persistent class not found    forum.hibernate.org





10. Getting table name for persistent class    forum.hibernate.org

Good point. It also makes me a little nervous holding on to the Configuration since it says in the documentation: Quote: A Configuration is intended as a configuration-time object, to be discarded once a SessionFactory is built. I would suggest adding table name to the meta data api, but I have a suspicion this would open up a can 'o worms ...

11. Persist class using Adapter?    forum.hibernate.org

I have a persistent class which I load using the Adapter pattern. For example: a) Proposal class is mapped and persistent b) ProposalAdapter extends Proposal but is part of another package and not mapped. It only job is to adapt to the persistent domain model. When I try to save the ProposalAdapter I get a "MappingException: No persister for ..." exception. ...

12. Persistence wrapper classes...    forum.hibernate.org

(I'm using Hibernate 2.1) I'm incorporating Hibernate into the backend of a client-server Swing program. The server has multiple RMI services that query for and pass off objects to the client. I'm currently converting the first service to use Hibernate as a test/proof of concept. Things are going fairly well on the server side - Hibernate is correctly querying for and ...

13. How can Hibernate persist a non-primitive class ????    forum.hibernate.org

Thanx Christian, In that case you can say that 3 is the correct way, but in other cases I might need to save the whole object AS-IS (for complex classes or classes which are not mine) that is why I do wish to know the syntax of All 3 ways of doing it. that would help me much !!!! as for ...

14. Examples of Persistent class (isUnsaved, others)    forum.hibernate.org

15. Persistent class not found    forum.hibernate.org

Here is my build.xml file. It can generate a 'classes' folder with the .class and .hbm.xml file in it but the schema export still cannot find the persistent class. I have read all the posts on classpath and now I'm getting a little irritated on why my build.xml file won't run Schema Export. As of right now my build file if ...

16. does it support nested class persisting?    forum.hibernate.org





17. Dirty objects and class="assigned" problem    forum.hibernate.org

Hi, I have a parent/child one to many association which is not behaving as I expect. Both maps have assigned keys with a version tag to aide in determining whether the object is new or old. child objects are added to a set in the parent class. So what I am expecting to happen is that when i add a child ...

18. How to save objects of derived class?    forum.hibernate.org

Hello, This is probably quite simple but I am not able to quite figure it out. Consider a class Outer which contains an objects of classes Inner1, Inner2, and Inne3. All the Inner classes extend the same class Inner and do not add any attribute to Inner. I would like to save this by specifying hibernate-mapping for Outer and Inner, but ...

19. Defensive Copies in Persistent Classes    forum.hibernate.org

21. Class Case doing update    forum.hibernate.org

I am getting a class cast exception when I try to edit an object in memory, which was pulled from the database. The exception is thrown when I call some of the setter methods in the bean, which was generated from the mapping file. Does anyone have any suggestions in how to troubleshoot this issue? Thanks. Here is the error: 5_0_, ...

22. Persist a same Class in diferent tables    forum.hibernate.org

Hi, it's possible to save a unique class in diferent tables? In my case i need to save a same class, called Message, in diferent tables. If the Object Message is processed bya method of the class 1 it must be saved in the table "class1" if it's processed by the class 2 save it in the table "class2" ang go ...

23. How do I persist a single class to 2 normalized tables? (Ho    forum.hibernate.org

Hello All. I have a normalized legacy table structure Im trying to map to a legacy class structure. I have 2 tables, named items and item_types (a lookup table), in which Ive included the SQL DDL. I want to map them to a class defined below. Ive included the mapping Ive used which works great for querying the data. However, Id ...

24. Problems saving more than one object of the same class    forum.hibernate.org

Hi, I have a HSQLDB (version 1.8) with 3 tables (Spiel, Satz, Zug). There are one-to-many-relations between Spiel and Satz and between Satz and Zug. The database works fine with Hibernate (version 3.1) except for one problem. In a normal execution of the main programm, one Spiel-object is created, then a Satz-object which is related to the Spiel-object, and then some ...

25. No persistent class found    forum.hibernate.org

Beginner Joined: Wed Aug 04, 2004 4:33 am Posts: 45 Location: Switzerland I'm doing a simple test with hibernate 3 and annotations. Here is the code and configuration I have. I get no exception, but a log entry saying that no persistent class has been found. Any idea? Thanks in advance! Hibernate version: Hibernate 3.1.1 Annotations 3.1 beta 8 Mapping documents: ...

26. Using Interfaces as base persistent class    forum.hibernate.org

Hi. During my investigation of Nhibernate found one interesting line in documentation: "It is perfectly acceptable for the named persistent class to be an interface. You would then declare implementing classes of that interface using the element. You may persist any inner class. You should specify the class name using the standard form ie. Eg.Foo+Bar." I tried it several times ...

27. How to customize the save() behavior of persisted classes    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3 What is the best way to have Hibernate call the save methods of my DAOs for objects that are persisted using cascading saves-updates instead of just persisting them for me? Id like to customize the save behavior for certain objects. For instance, lets assume I have the following ...

28. hibernate won't persist my classes!!    forum.hibernate.org

29. Persistent class not known    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp When I'm starting the applicatiopn it gives me the folowing error; The hmb, and the classes are there. Anyone? Hibernate version: 3.0 Mapping documents: PESSOA_SQ ...

30. How to change class types of persistent objects    forum.hibernate.org

Hibernate version: 3.0 Full stack trace of any exception that occurs: Name and version of the database you are using: Oracle 9i I wonder if it is possible with hibernate to change the type of a derived class of an object which is already persistent. In my case, i have the class Customer and two joined Subclass 'PotentialCustomer' and 'BuyingCustomer' derived ...

31. Persisting Inner Class    forum.hibernate.org

32. persisting sub classes    forum.hibernate.org

Hi, I'm attempting to use a generic storage mechanism for a variety of objects in my system. I have defined a standard base object called Node which holds all the properties and methods that can be performed on them. Classes which extend Node are only permitted to add useful API calls on top of the functions offered by the Node. For ...

33. Hibernate does not return the persistent class type object?    forum.hibernate.org

Hibernate version:3 Code between sessionFactory.openSession() and session.close(): I am using the following code : List results = session.createCriteria(MyClass.class) .setProjection( Projections.projectionList() .add(Property.forName("Property1")) .add(Property.forName("Property2")) .add(Property.forName("Property3")) .addOrder(Order.desc("Property3")) .addOrder(Order.asc("Property1")) .list(); It does not return me Objects of type MyClass but returns object of type Object class of java.Can anyone help me in getting the object of type MYClass only with these particular properties only.Thanks in ...

34. How to resolve persistent class from table name    forum.hibernate.org

Hello, Given a table name, is there any way to look up what persistent class it resolves to? I have a text table name and primary key and want to get hold of the corresponding hibernate object. I suppose I could parse the mapping files myself and have some kind of factory but I am hoping as these are already parsed ...

35. about persistent class    forum.hibernate.org

36. persisting two classes into the same table    forum.hibernate.org

37. get last (overall) class update    forum.hibernate.org

38. Persisting some unusual classes.    forum.hibernate.org