Version « Map « JPA Q&A





1. Upgrade of Hibernate from version 3.0 to 3.6    stackoverflow.com

I'm working on a project which uses Hibernate 3.0(released in 2005), though the project itself is only 4 months old. The catch is we have already written millions of lines of ...

2. Tell Hibernate to use @Version instead of @Id to check persistence state... using annotations?    stackoverflow.com

I am struggling with the problem described here. I have a persistent class that I want to make collection-safe by overriding hashCode() and equals(). Because my entity doesn't have ...

3. Hibernate: Updating version in child records    coderanch.com

In my test application, I have two tables; J_TRADE and J_CASHFLOW. Trades may have zero-to-many associated cashflows. J_TRADE has ID as its primary key, and a version column. J_CASHFLOW references the trade ID column and the trade VERSION column. The mappings are as follows:

4. Hibernate mapping and versioning issues    coderanch.com

Hi all, I am having a few problems with hibernate, one we wont go into. I have two tables, a User and a UserRole table, now the UserRole is the parent of User, so there is a one-to-many relationship there, but between User and UserRole it is a one-to-one relation ship which I am trying to map thus:

5. Hibernate Versioning in Inheritance    coderanch.com

6. @Version and Inheritance    forum.hibernate.org

Hi, I need help with @Version and Inheritance. This is what I am doing. @MappedSuperclass class BaseClass{ @Version @Column(name = "version") int version; ... } @Inheritance(strategy = InheritanceType.JOINED) @Table(name = "A") class A extends BaseClass { ... } @Table(name = "B") class B extends A { ... } } Physical table for B has a version and so does A. When ...

7. Map to different versions of a table    forum.hibernate.org

Hello there. I need to add a new field to a database table that is already in production. On top of that, my project is only going live a year from now. In the meantime, there will be other projects being released, and we are using XML files to define "switches" where we can turn some functionalities on and off. The ...

8. Versions of an object - use inheritance or not ?    forum.hibernate.org

Hello, In our application we have an object that holds all the details of a Project. At some point we decided we needed versions for a Project so we created a new class ProjectVersion and made Project a child of this class (ProjectVersion has the project fields declaration now). Also we added a class ProjectGroup that holds the original project id ...

9. Version and Parent/Child relationship?    forum.hibernate.org

Hi I am working with some objects basically in the usual parent/child relationship. I am using version columns in both objects so I can manage concurrent updates among objects. I am baffled however on how versioning gets applied when the parent object is saved. A couple questions: 1) If parent is modified, children not modified, parent is saved, does it also ...





10. Overriding the value of the version number    forum.hibernate.org

Hibernate version: 2.1.2 We are using the "Many sessions with automatic versioning" approach on our application (section 17.3.2.). We have a brand new Hibernate Session for each service layer request and we use DTOs to communicate across the service boundary (ie. the client never sees the domain objects). I think I have seriously misunderstood what we could do with this functionality, ...

11. Version mapping declaration    forum.hibernate.org

12. Invalid Mapping if both and     forum.hibernate.org

Thanks for the prompt reply, Michael. And sorry about the stupid post. I should have looked at the DTD. Another question is, why cant both the version and the timestamp elements both be present for the same class mapping? All our legacy DB tables have the following two columns - lock_num (number) and last_modify_dt (date). We use lock_num for versioning, and ...

13. version column problem for value collection mapping    forum.hibernate.org

is a tag used in association with an optimistic-locking strategy. It is generated automatically by the database in most cases. There is a "generated" property for the version that defaults to "never". You have to tell Hibernate that it will be generated by the database. There is a discussion of this in section 5.1.7 of the Reference Manual (version 3.1.1). ...

14. Map a product and be able to store historic version of the p    forum.hibernate.org

Hi, I have a product with productNo, productVersion and so on. I want to work with only one version of my product and sometimes create a new version and save the old one and be able to reverse to the old product. Example Product.productNo= 100, Product.productVersion=1, after a while a new better version of the product is developed and it shall ...

15. version field of child object not refreshed    forum.hibernate.org

No body knows about it? Perhaps is my question not understandable. Here an example : child.save() => version of child = 0 in object and database child.update() => version of child = 1 in object and database parent.setChild(child) => version of parent = 0 in object and database but the version of child = 2 in database and stay = 1 ...

16. How to increment parent version when child is updated?    forum.hibernate.org

hi all, From the document of hibernate, for objects with one-to-many relationship, when the new child is added to the collection, or when a child is removed from the collection, the version number of the parent object will be updated on persist. My question is, how should I do if I need the same behavior when the child attribute is being ...





17. Version column and Joined Inheritance    forum.hibernate.org

The EntityManager.lock() seems to use the wrong column name when it is passed a sub-type entity froma joined inheritance strategy. ie, I would expect to see: update SUPER set ROW_VERSION_SEQ=? where SUPER_ID=? and ROW_VERSION_SEQ=? but instead I see: update SUPER set ROW_VERSION_SEQ=? where SUB_ID=? and ROW_VERSION_SEQ=? which throws a org.hibernate.exception.SQLGrammarException: could not retrieve version: because column SUB_ID does not exist on ...

19. Entity with Map causes problems with versioning?    forum.hibernate.org

Newbie Joined: Mon Sep 08, 2003 5:47 pm Posts: 9 Location: Denver I have an entity with a property that is a Map and uses an version # for optimistic locking. When I load an instance of this class using Code: session.load(ClassWithMap.class, idValue) and resave the object with saveOrUpdate() the version # does not change. This is good, because the ...