Legacy « Map « JPA Q&A





1. Legacy mapping with hibernate    stackoverflow.com

For my current project I have to map a legacy database using hibernate, but I'm running into some problems. The database is setup using one 'entity' table, which contains common properties for ...

2. one-to-many mapping // how to map an association of legacy tables (Hibernate)    stackoverflow.com

I've got two legacy database tables, layouted in simplified manner like this:

MASTER                   ...

3. @ManyToMany without join table (legacy database)    stackoverflow.com

I have to apply JPA in a legacy database with an awful design. Unfortunately is not possible to change it. Luckily is only for read-only access. One of the strangest things ...

4. Hibernate Annotations with a legacy mapping table    stackoverflow.com

I'm trying to convert part of a data-access layer into hibernate and running into some trouble getting the collection association right. I am using hibernate annotations, and have two Entities that ...

5. Hibernate / JPA: Map a legacy database Not Null Foreign Key 'Dummy' value as NULL    stackoverflow.com

JPA 1.0, Hibernate 3.4* I have to develop a JPA solution over a legacy system where FKs are defined as NOT NULL, hence have a default value of -999999 where an optional ...

6. Legacy database mapping issue with JPA 1.0    stackoverflow.com

I have a problem with mapping a legacy database with JPA 1.0. The database is stored denormalized for data-mining purposes. I condensed it to a simple example that hopefully clarifies the ...

7. Hibernate: Mapping a one to many relationship on a legacy table that uses columns as rows for the one to many relationship    stackoverflow.com

I am working with a table on a database that I cannot change. The table has a list of user contacts for example email, facebook, twitter etc. Each of these contacts ...

8. Legacy inheritance mapping and Hibernate    coderanch.com

Hi! I'm trying to replace an old persistence layer with Hibernate. A rather uncommon inheritance mapping is in use, I hope this example helps to clarify: Looking at the mapping options in Hibernate, on first sight it seems to resemble "Table per subclass". But this strategy lacks a certain speciality I tried to show in the example: The property values for ...

9. Trouble Mapping Legacy DB    forum.hibernate.org

I have a legacy database that I am trying to use Hibernate with and am having trouble creating relationships between three beans. I am unable to change the schema of the database so must adapt my code to get things to work even though I know the table design is suboptimal. Here are the details: DB tables: d_code ----------- code person_id ...





10. mapping for legacy database    forum.hibernate.org

11. Legacy Mapping simple Linked List    forum.hibernate.org

12. Legacy database many-to-many mapping help    forum.hibernate.org

Newbie Joined: Thu Dec 02, 2010 9:55 am Posts: 1 Hi all, I am having trouble mapping the following database structure (shortened for brevity with just PKs/FKs and a few extra columns: Policy --------------- Policy_Id (PK) ... Risk --------------- Risk_Id (PK) ... Party --------------- Party_Id (PK) ... PartyRole --------------- PartyRole_Id (PK) Party_Id (FK not-null) Policy_Id (FK) Risk_Id (FK) Party_Role_Type So the ...

13. Question about Legacy db mapping    forum.hibernate.org

Hi, I have to map an existing legacy db application to Hibernate. Table Master { int id; .... int type1code; int type2code; int type3code; int type4code; int type5code; } and a metatable { int id; string type; int code; string name; } I want to create a Master entity object with the existing properties along with the name from the metatable. ...

14. Issues mapping legacy data    forum.hibernate.org

15. Mapping parent-child association from legacy db using natura    forum.hibernate.org

Hi. I'm trying to use Hibernate to access a legacy database, in which there are a lot of tables which are related similar to this: PARENT: TEXT_ID TEXT_TITLE CHILD: TEXT_ID TEXT_LINENUMBER TEXT_LINE The primary key of CHILD is a composite key consisting of TEXT_ID and TEXT_LINENUMBER. TEXT_ID is also a foreign key referring to the parent. How do I get Hibernate ...

16. Some thoughts about "legacy" many-to-one mappings    forum.hibernate.org

Hi, I hope this small "philosophical" topic is not off-place here. Since I'm migrating a legacy DB app to Hibernate I'm facing lots of issues related to the old design of the original application. But since the new application has a new database, I had the chance to modify the schema. I've got a copy of Hibernate in Action and went ...





17. Legacy data mapping - use adapters?    forum.hibernate.org

Hi, If I have a legacy table which needs to be accessed via an interface. Is it best to use an adapter or make the Hibernate mapped class implement the interface? Implementing the interface will require manipulating data. I've used adapters and wrapped the Hibernate mapped classes up when they're loaded via the DAO but I'm having problems with the collections ...

18. Mapping legacy entity with collection of collections    forum.hibernate.org

Hi all, I am working with a legacy database that has a relational model something like this: Code: table orders column id int primary key ... {etc} table charge_lines column order_id int } Combined primary key column line_no int } ... {etc} table product_lines ...

19. How do I map this? (Difficult scenario for legacy system)    forum.hibernate.org

Hi all, I recently ran into a difficult mapping scenario in a legacy database. Appreciate if any guru out there that can help. Table A --------- PrimaryKey1 LogicalKey_B LogicalKey_C DataField_A1 Table B --------- PrimaryKey_B LogicalKey_B DataField_B1 Table C --------- PrimaryKey_C LogicalKey_C DataField_C1 Now, if A.LogicalKey_B is the key field to be used to join with B.LogicalKey_B, how would I map that? ...

20. Help with a legacy mapping    forum.hibernate.org

Newbie Joined: Wed Nov 23, 2005 11:37 am Posts: 9 Hi all. I'm getting my feet wet with Hibernate and have a tricky legacy database mapping that I need some help with. I have two tables in a Parent/Children like relationship: a "registration" (think of this as a representation of the current state of a registration) and an associated "history" of ...

21. Question regarding mapping for legacy database    forum.hibernate.org

22. Issue mapping legacy database    forum.hibernate.org

Hello I'm mapping a legacy database with hibernate 3.1. I have an issue with a convention on the legacy database mapping (witch is also OR mapped manually by a legacy application) and I can't find a good way make hibernate 'live' with it. The problem is the the legacy ORM uses -1 to mark an non established many-to-one relationship. I've allready ...

23. Legacy Database Mapping Problem    forum.hibernate.org

Hibernate version: 3 with JPA Annotations Hi, I'd appreciate some advice about how to map the following example, is a legacy database and some existing classes that I'm trying to annotate. The bean structure can be simplified as: Group: (PK) int groupId; (oracle sequence) Set getRequests(); Request: PK (group) PK int requestID (oracle sequence); getter for group; So essentially group has ...

24. too many selects w/1-1 legacy mapping    forum.hibernate.org

When a select is issued as illustrated, there is the expected JOIN issued, but then there is a select issued for every qts_person row that is a User instance; see generated SQL portion. I'm stuck with the [some?] reference to the AuthUser object; a wrapper for a legacy table. Is this a bogus strategy/mapping, or is there something else happening here? ...

25. Oddball mapping of legacy data    forum.hibernate.org

I am pretty new to Hibernate. My agency is converting hundreds of legacy COBOL programs to java. This also leaves us with a fairly ugly legacy database that is slowly being normalized. We are still having to use the legacy data prior to the normailization. Here is the problem I am currently facing: Two entity classes, each with three column keys, ...

26. Mapping a legacy T/F varchar2 column using annotations    forum.hibernate.org

ERROR - RequestCycle - For input string: "F" java.lang.NumberFormatException: For input string: "F" at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224) at java.lang.Double.valueOf(Double.java:447) at oracle.jdbc.driver.OracleStatement.getBooleanValue(OracleStatement.java:4500) at oracle.jdbc.driver.OracleResultSetImpl.getBoolean(OracleResultSetImpl.java:479) at oracle.jdbc.driver.OracleResultSet.getBoolean(OracleResultSet.java:1561) at org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.getBoolean(DelegatingResultSet.java:227) at ...

27. legacy queries/mapping    forum.hibernate.org

Hi, Does hibernate support the ability to map one field to another field within the domain model and allow HQL queires to use the former. Use Case for this would be where we have a huge set of HQL queries that use the current domain model.Non-trivial changes are made to that model.The large set of queries prevent us doing this in ...

28. legacy DB mapping problem    forum.hibernate.org

I have a legacy mapping problem. I have two tables: Table A: - a_id (PK) Table B: - a_id (composite PK part 1) - index (composite PK part 2) - type (composite PK part 3) (can be 'I' or 'O') horrible, and I can't change it. Anyway, in java I want EntityA - List iList; - List oList; where the members ...

29. Problems mapping a manytoone legacy association (Thanks ;-))    forum.hibernate.org

You can make us of the folowing mapping in the City class mapping provided you change the String regionCode; --------------to--------------- Territory regionCode; String class needs to be replaced by Territory class. In the above mapping, element-ref will ask the hibernate framework not to use primary key of Territory class instead use what I have given i.e. ...

30. Mapping of legacy N-N mapping    forum.hibernate.org

31. Uncommon inheritance mapping due to legacy database    forum.hibernate.org

Hi, I have to replace a self built OR layer with Hibernate. So I got to deal with a legacy database that reflects inheritance in a special way. Let me explain step by step. The inheritance hierarchy for persistent classes only allows concrete (non-abstract) classes for the "leaf classes". There are no intermediate concrete classes. In the database are tables for ...

32. collection mapping of legacy database    forum.hibernate.org

Hi, Here is my question. I have two tables : Product and Translation. Translation contains both name and description of each product in several languages. The DDL looks like : Code: Product ( prod_id NUMBER(10) PRIMARY KEY, name NUMBER(8), description NUMBER(8) ); Translation ( trans_id ...

33. Legacy database and ManyToOne association    forum.hibernate.org

I have a difficult problem with a ManyToOne association. I'm having to map against a legacy database that I cannot alter or change data inside. In this database, numeric foreign keys are not null if the association does not exist, instead they are set to 0. So, for example: Code: @Entity @Table(name="PROVINCE") public class Province { @Id ...

34. map a legacy system    forum.hibernate.org

I need to map a legacy system: public class A{ private AId id; private Map m1; private Map m2; ... } public class Aid{ private String id; private String type; ... } database: table AA{id, type, .....} table BB{id, is_fine, ....} (type is really of no use at all but I can not change the java code or the ...

35. Dynamic Data Mapping for Legacy App    forum.hibernate.org

Im new to Hibernate and looking into moving a legacy application from hand-coded persistence to Hibernate. The application uses a dynamic data model (Maps, not JavaBeans) so Im using Hibernates MAP entity mode. So far my attempts require either a change to the data or to the database schema. The essence of the problem is that in the application, map A ...

36. Mapping of legacy DB, table per class hierarchy    forum.hibernate.org

Hello, I'm mapping a legacy DB in hibernate and I have the following problem: I have a parent class A and two subclasses B and C. This mapping looks as follows and works fine: Code: ...

37. Mapping of legacy DB, table per class hierarchy    forum.hibernate.org

Hello, I'm mapping a legacy DB in hibernate and I have the following problem: I have a parent class A and two subclasses B and C. This mapping looks as follows and works fine: Code: ...

38. Legacy Database Mapping problem    forum.hibernate.org

Hi, I'm dealing with a legacy database where I have all business primary keys (complex keys), no foreign keys. And for worst, there are no null columns defined, instead, when a column is optional, if it is not informed it will be zero or space depending on the sql type. So if I use standard hibernate mapping and define an optional ...

39. Mapping to legacy database - key/value style association    forum.hibernate.org

I think I have another angle on this. Basically, I'm writing this as a read-only access layer for an existing schema. I'm wondering if I can approach this as an entity with an embedded ID. I'll try my take on it and see if I can get some success with making this work and post my findings back here. This is ...

40. problem mapping legacy tables    forum.hibernate.org

...

41. mapping legacy database to java    forum.hibernate.org

I don't understand how to use the generated java code from the hibernate tools. I have 3 tables, USERS, HOSTS, and HOSTS_IN_USE. The USERS table has a primary key ID column, varchar NAME, etc. Same with the HOSTS table. The HOSTS_IN_USE table has 2 columns, USER_ID and HOST_ID; when a host is in use the IDs for it and the user ...

42. Simple Legacy Map for Beginner    forum.hibernate.org

Author Message wil.pannell Post subject: Simple Legacy Map for Beginner Posted: Tue Aug 18, 2009 6:54 pm Newbie Joined: Tue Aug 18, 2009 6:28 pm Posts: 1 I must be missing something simple, but everything I tried, especially property-ref, did not work, and I don't want to resort to a formula. I have 2 tables, Report and Image, that ...