Map 7 « Map « JPA Q&A





1. one-to-one mapping    forum.hibernate.org

I'm having a lot of trouble mapping a one-to-one relationship. I tried with a foreign key asscociation and with both table's primary key's matching. Can someone please show me how to do this? I have 2 tables : QueryGroup and GroupEmailInfo. I want the QueryGroup class to contain GroupEmailInfo as a member. When a new queryGroup is saved I want the ...

2. Mapping Editor doesn't seem to work on 3.1 alpha 5    forum.hibernate.org

I installed the plugin per instructions. I get the whole hibernate perspective and can start the configuration console and such, but when I open a hibernate mapping configuration file the mapping editor does not appear to activate. I am using eclipse 3.1 for linux. The only other plugins i have installed are the spring framework and I also have the xmlbuddy ...

3. Problem with one to one mapping    forum.hibernate.org

4. Hibernate mapping when using a long[]    forum.hibernate.org

Hi, I'm fairly new to Hibernate and am using version 3.1 I've two tables that I'm trying to map using one object on the java side. The primary table STEP has an ID column that is the FK in STEP_PREV table. This second table only has one more column (called PREV_ID NOT NULL NUMBER) besides the ID column. The mapping document ...

5. Mapping a one to many without FKs    forum.hibernate.org

I'm using hibernate 3.0.5 and I'm trying to create a 1 to m relationship with the

6. mapping problems    forum.hibernate.org

Hi, I am a newbie for the hibernate and the OR mapping, and currently i am having a problem with mapping the Table to the Object. We are having a scenario, where we store the Type and the Date (Key, Value) pair in the table, with the designed table structure and i wanted to know how this can be mapped with ...

7. many-to-many mapping doubt    forum.hibernate.org

Hi, I have these xml files: Code: ...

8. Mapping Question    forum.hibernate.org

Hibernate version: 3.05 I have a mapping question that I have not been able to find an example for. I have a class A, which is composed of composite instances of class B, and C. Likewiae, class B, and C, are composed of composite class instances of class D, and E. My question is. How do I map this relationship so ...

9. m:n mapping structural question    forum.hibernate.org

I am just wondering on what the ideal way is to deal with such a situation. I have an m:n mapping over a mapping table, which has extra attributes. Dutyfully I mapped it to an m object a mapping object and an n object so far so good. Now I want to readjust the mapping at a certain stage of my ...





10. Problem with 1:n mapping    forum.hibernate.org

hi there, i have a tiny problem with correct 1:n mappings in hibernate. E.g. I have two tables, one table containing languagedescriptors in certain languages for "*_mldID" keys, which are stored in tables containing data which has to be shown in certain languages within the application. e.g. TABLE roles containing the following fields roleID roleName_mldID (Name of Role: is a unique ...

11. Still Problems with "multiple" 1:n mappings    forum.hibernate.org

hi there, i have a tiny problem with correct 1:n mappings in hibernate. E.g. I have two tables, one table containing languagedescriptors in certain languages for "*_mldID" keys, which are stored in tables containing data which has to be shown in certain languages within the application. e.g. TABLE roles containing the following fields roleID roleName_mldID (Name of Role: is a unique ...

12. Howto map implements of multiple interfaces    forum.hibernate.org

Hi, I have a question on if it is possible (and how) to map a class which implements multiple interfaces. I want to map the interfaces as superclasses of the class (is mentioned as an approach in the manual), in addition I would like to query for instances of the class using either of the two interfaces (and their properties). An ...

13. one-to-many mapping to an interface    forum.hibernate.org

Hibernate version: 3.0.5 Hi, I am having difficulty working out the correct mapping to use for a one-to-many relationship to an interface. I'm sure that this question has been asked before, but after doing a fair bit of reading and searching on the forums I have yet to find a solution. Consider the following class hierarchy (which is a subset of ...

14. problem with compling the mapping document.    forum.hibernate.org

this is what i got while initializing the database....but am not able to locate the error...can anybody help me [sql] 0 rows affected [sql] 0 rows affected [sql] 0 rows affected [sql] 0 rows affected [sql] 0 rows affected [sql] 0 rows affected [sql] 0 rows affected [sql] 55 of 55 SQL statements executed successfully [java] 2005-09-20 10:16:23,984 ERROR org.hibernate.cfg.Configuration - ...

15. Multiple Mappings    forum.hibernate.org

I'm baffled by this... I have a class Student. Student has a set, FirstChoices, a set, SecondChoices, and a set, Courses. All three of these sets are of type Course. I also have tables Student, Student_FirstChoices, Student_SecondChoices, and Course_Student. For the *most* part, this goes fairly smoothly; however, when I do an inclusion check to see if the student has a ...

16. Really basic question about Hibernate mapping    forum.hibernate.org

I'm trying to understand what Hibernate provides or looking at it from the opposite direction, what a developer does not need to provide when using Hibernate. With this in mind, I'm confused about type casting on retrieval. For example, I have a Java class with an Integer attribute. This attribute is stored in the db as an int. In a JDBC ...





17. mapping hell    forum.hibernate.org

Beginner Joined: Thu Sep 08, 2005 9:24 pm Posts: 20 Location: Boise Idaho I'm new to Hibernate and am having some very serious problems trying to do something which is *very* simple in basic SQL code - join two tables together in a one-to-many relationship. I've got two objects w/ a "one-to-many" parent/child association, real simple stuff. I am trying to ...

18. Hibernate 3.x Implicit Mapping?    forum.hibernate.org

I would say no. Don't forget that databases model 'has-a' relationships, not 'is-a', so the database wont understand that RealEmployee extends Employee. Without the mapping file how would Hibernate know which properties of RealEmployee to persist? Chapter 3.6 of Hibernate in action gives a very good overview of inheritance. Also chapter 10 of the docs should help.

19. Many-to-many mapping problem    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3 I have many-to-many reletationship between product and performer; I have mapped the table product twice: to BasicProduct and InactiveBasicProduct (that was not my idea - but others call the shots ;-)). The mapping for InactiveBasicProduct works fine, if I don't add a set for my many-to-many relationship. If ...

20. How can I map a map of map?    forum.hibernate.org

Hi, I want to create a hibernate mapping for a map of map, say Map>, I know I can crreate another class B { Map innerMap; } and then map Map. But in such way, I have to create a lot of extra classes just for hibernate mapping. Is there a better way to do it? ...

21. Problem with mapping    forum.hibernate.org

Hello, i'm a new user of Hibernate mappings in my Java classes via Doclets. And i have a few problems to resolve certain mappings... I often have the following context : - Class A - Class B These two classes are linked (n-n) by an association class C, witch have its own attributes (a kind of valuation of the link). My ...

22. Mapping one-to-many with Map    forum.hibernate.org

23. a one-to-many mapping problem?    forum.hibernate.org

24. Many to one mapping - skipping position 0    forum.hibernate.org

Hibernate version: 2.1.8 Name and version of the database you are using: Oracle 9i Hello. i've got a major hibernate mappings problem... I have a one to many relationship between 2 classes: IndexRecord and IndexValue. The mapping in IndexRecord looks like this: And for IndexValue:

25. What is wrong with this mapping?    forum.hibernate.org

I have a class called Category with a list of entity objects called LinkInfo. When I remove a LinkInfo from the list, I would like the entry to be deleted from the LinkInfo table. There must be something wrong with my mappings, because when I remove an item from the list Hibernate tries to set the entry in the LINKS table ...

26. mapping documents in different direcyory than calling class    forum.hibernate.org

Id like to keep hibernate objects and mapping documents in a seperate directory from the class thats calling them. My application works fine and then I move all the .hbm.xml and hibernate classes to their own directory, change the .cfg.xml files to update this move and change the mapping files to reflect it as well and yet hibernate is still looking ...

27. Mapping a java bean    forum.hibernate.org

I'm new to Hibernate and am having some difficulty understanding the relationship between my object, the mapping for that object , and the table for that object in the database. The sample consists of a Superhero that has a Gadget and an Identity. They are simple and can be seen below. My database tables for Gadget and Personal match their respective ...

28. Trouble with class that needs to implement Map    forum.hibernate.org

Author Message mwbecker Post subject: Trouble with class that needs to implement Map Posted: Fri Oct 21, 2005 12:12 pm Newbie Joined: Tue Oct 11, 2005 4:18 pm Posts: 8 Location: Washington, DC I am trying to create a mapping for a class, MyBeanMapImpl, which I need to have implement the Map interface within my application. As far as ...

29. which mapping shud I use and how..    forum.hibernate.org

Hi, I am new to hibernate and needed help on which mapping I shud use. I have class Vehicle. This class contains an object of type VehicleType. There can be many vehicles of one particular type. I was using a many-to-one unidirectional mapping between Vehicle and VehicleType with a foreign key in Vehicle mapping to the primary key in Vehicle Type. ...

30. which mapping shud I use and how..    forum.hibernate.org

Hi, I am new to hibernate and needed help on which mapping I shud use. I have class Vehicle. This class contains an object of type VehicleType. There can be many vehicles of one particular type. I was using a many-to-one unidirectional mapping between Vehicle and VehicleType with a foreign key in Vehicle mapping to the primary key in Vehicle Type. ...

31. Mapping question    forum.hibernate.org

32. many to one mapping question    forum.hibernate.org

Basically we can map a many-to-one with only one field but why can't we map a many to one with two fields. In the first mapping we have a table that we need to map accountnumber and timestampid as the key and then another that we need to map urn and timestampid to. Are we using the right method of mapping. ...

33. Difficulty with mapping many-to-one    forum.hibernate.org

Author Message massep Post subject: Difficulty with mapping many-to-one Posted: Mon Oct 24, 2005 7:01 pm Regular Joined: Thu Aug 19, 2004 9:28 am Posts: 63 Hi, I'm not sure if this is a bug or I just don't map my association right. I'm trying to map 5 columns from table 1 (personExpertise) to table 2 (discipline). The 5 ...

34. Interesting mapping question    forum.hibernate.org

Newbie Joined: Fri Jun 24, 2005 10:40 am Posts: 17 I have an interesting situation and I am looking for ideas on how to map it. This is complicated so please bear with me. We are creating a unit and scale api in which the unit and scale are concrete classes derived from the base class. For example: BaseScale: import java.io.Serializable; ...

35. one-to-one mapping question    forum.hibernate.org

hi I am using Hibernate 3.0 and had the following question Does hibernate support the following? 1) one-to-one foreign key association if the foreign key is also a primary key or is part of a composite primary key. For instance I have a table Transaction where primary key is TransactionId and I have a table Payment which has a composite primary ...

36. EnumSet mapping    forum.hibernate.org

Hopefully this will help someone. To map an EnumSet (or any Set or Collection of Java 5 enums), just use Hibernate's feature. It works quite well, for loads, saves and queries. Here's a code example: (in your Java class) public enum TestAction { MASTER_POOL, PRIMARY_POOLS, INDIV_SAMPLES, NONE } private Set requiredActions = EnumSet.noneOf( TestAction.class ); (in your class' .hbm.xml ...

37. hibernate mapping    forum.hibernate.org

38. invalid mapping    forum.hibernate.org

I get this error with the following xml: org.hibernate.MappingException: invalid mapping The content of element type "primitive-array" must match "(meta*,subselect?,cache?,synchronize*,comment?,key,(index|list-index),element,loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?)". ** props is the name of my property defined as: double[] props - in my class ** I picked an arbitray name for the index column. I'm not sure how to get the index column of ...

39. Hibernate one-to-one mapping problem    forum.hibernate.org

I am using Eclipse to generate Hibernate mappings from an Oracle 9 database. I have two tables INSTRUMENT (primary key is id) and OBJET (primary key is id) INSTRUMENT.id is also foreign key to OBJET.id. When I generate a mapping , below is what i get. The mapping for foreign key is not generated and i don't know how to complete ...

40. Hibernate one-to-one mapping problem    forum.hibernate.org

41. Maping of (Hash)Maps    forum.hibernate.org

public class A { Map m = new HashMap(); Long id; ... public string getStrForMapId (Integer key) { return (String) m.get (key); } public static A[] findAcontatingStr (string str) { //query the DB } }

42. one-to-many, mapping    forum.hibernate.org

Hi, I'm using Hibernate 3.1. I have the following scenario: I have a parent object encapsulating a List of child objects inside it. There are two tables in the database (SYBASE), which stores this identity mapping with the help of an Id column. When trying to retrieve the parent and print the child, it gives the following exception: org.hibernate.LazyInitializationException: cannot access ...

43. Mapping arrays - hasn't anyone done this??!!    forum.hibernate.org

I have searched the online documentation exhaustively (is that a word?) and I finally went out and bought a Hibernat book and I have yet to find any clear and definitive examples of mapping an array in a hibernate xml document. Specifically, I am trying to map arrays of Strings and arrays of doubles. It seems that the documentation takes you ...

44. Mapping Question involving sets    forum.hibernate.org

Hi, I have a major problem in mapping my DB schema. My DB schema is like that Class Store{ Map Items; //item can be in more than one location; } class ItemLocations{ Set locations; } class Item{ ... ... } DB: CREATE TABLE STORES ( ID NUMBER -->PK , ... ) CREATE TABLE ITEM_LOCATIONS ( STORE_ID NUMBER NOT NULL, ---> PK ...

45. newbie mapping question    forum.hibernate.org

Hibernate version: 3.1 Mapping documents: I have a mapping question, which is probably answered somewhere but I'm not familiar enough with your jargon to correctly search for it. I have 3 tables involved. Table A has an ID Table B has two IDs one unique across the table and one Company ID. Table X has A_ID, B_ID, B_COID. (such that one ...

46. Suggestions, please, for mapping of complicated heirarchy?    forum.hibernate.org

I have an interesting situation with trying to map a class heirarchy, and can't seem to find the best solution for it. I was using hibernate 2.0, but have upgraded to 3.0 as there appears to be more flexibility with its mappings. I have two tables like so: Code: +---------------+ |template | +---------------+ | id ...

47. set mapping    forum.hibernate.org

Hi, I have a bidirectional many-to-many mapping. On one side collection of entities A is mapped to entity B collection. I am using mapping in my hbm.xml because I don't need indexed column. I sort the order of entites A by using order-by attribute, and it is crucial that the order is perserved. Can I use in my mapping ...

48. Mapping question    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3 I have 2 tables in my database (MySQL) - event and vendor. An event can have many vendors assigned to it and conversely, a vendor can be assigned to many events. So, from my perspective there is 2 one-to-many relationships. My plan is to have an association table, ...

49. How can I do this mapping:    forum.hibernate.org

Im looking for a way of doing the mapping for this relationship: A Document entity has a reference for a File entity. The relationship is an unidirectional composition:a Document has 0 or 1 File and a File always belongs to one and only one Document. In the data base I have the Document table and the File table. The File table ...

50. Problem with many-to-many mapping    forum.hibernate.org

...

51. Clarification regarding mapping    forum.hibernate.org

I have a very basic query. If i am using many-to-one relationship, then in mapping file for the class of many-valued end, why do we have element. cant we use element and in its "type" attirbute mention the class name of single-valued end. besides element could have included optional "cascade" and "outer-join" attribute. Pls correct me if am ...

52. mapping problem    forum.hibernate.org

Hallo, i am wondering if someone could help me with my little mapping problem. I already read the coresponding parts in the reference manual but i could not figure it out. My mysql database has the following scheme: productTable (common values for all products and shops) productType1 productType2 productType3 i will map this to the following classes product (interface) shopProduct (customer ...

53. one-to-zeroOrOne mapping ?    forum.hibernate.org

Regular Joined: Sun May 08, 2005 2:48 am Posts: 118 Location: United Kingdom I am trying to confirm my relationship configuration is correct. It is like one-to-one but one side is optional and there is a bi-directional association which is NULL when the optional side does not exist. This is all contained within two tables. I have been using many-to-one mapping ...

54. Mapping question    forum.hibernate.org

Code: ...

55. PreparedStatement of mapped Class    forum.hibernate.org

Hi everyone, i'd like to know if there is a way to get the preparedstatements that hibernate use to insert/update/delete mapped class. In pratice, i suppose that hibernate caches statements of mapped class to do insert/update/delete operations, and i need them. Is it possible? I've tried to look for org.hibernate.*, org.hibernate.cache.*, org.hibernate.impl.* packages, but i've found nothing. Thanks everyone!

56. Conceptional question about mixed mapping    forum.hibernate.org

Hi, I'm currently migrating our framework from Castor to Hibernate, and therefore revisited every part of it again. So did I for the SQL mapping part. I had a (maybe somewhat crazy) idea of mixing mappings and at a first glance at the docs it looked like hibernate would support that (it even *was* the docs which inspired me, even...). First, ...

57. mapping multiple interfaces    forum.hibernate.org

Hiya, I have spent several days trying to figure this out. I have class User Extends Contact implements Resource, CanLogin { ... } In hibernate, I map contact as the superclass and all that works fine. I also mapped canlogin (since there are other objects that can login) and that works fine. However, mapping resource does not work as expected. I ...

58. Mapping-Problem with     forum.hibernate.org

Hi ;) im using Hibernate 2.8.1 and MS SQLServer2005. I have two tables (a,b) with the relation 1:n. In the mapping-file of table a i define a set wich references the foreign key of table b. Now comes the problem!! The values in that foreign key are not the values from primary key of table a! This values are content of ...

59. many-to-one Mapping problems    forum.hibernate.org

60. many-to-one Mapping problems    forum.hibernate.org

Newbie Joined: Thu Jan 05, 2006 11:58 am Posts: 3 I have a class called TransportJob which has a field called jobId which is a primary key) and another class called TransportJobSegment which has jobId as a foreign key. A TransportJob has many TransportJobSegments. I am able to save the TransportJob in its table, but when I save the TransportJobSegment in ...

61. How to use the MAP EntityMode?    forum.hibernate.org

Hi everybody, I am trying to use the MAP EntityMode feature of hibernate as follow: i created a mapping file (hbm) for one simple "User" class: Then, i created my Configuration object and my SessionFactory, ok everything went ...

62. Forced to use set instead of map    forum.hibernate.org

Converting an existing non-hibernate app to Hibernate. (3.0) I need to re-use a column for both the index and as a property in a composite element (see the ObjName column/property in this example): Mapping documents: Code: ...

63. Uni and bi-directinal mapping    forum.hibernate.org

there is no difference in uni /bi directional relations for hibernate compared to RDMS . uni directional mean you can navigate to only one side of relationship where as for bidirectional , it is possible both ways eg : cat --> kittens (uni) cat <--> kittens (bi) you may refer to chapter 7 of reference doc

64. Problem with mapping in hibernate    forum.hibernate.org

Author Message mik100 Post subject: Problem with mapping in hibernate Posted: Mon Jan 23, 2006 4:32 pm Newbie Joined: Mon Jan 23, 2006 4:11 pm Posts: 1 I am using hibernate 3.0 While trying to start a a Session, some of my hibernate .xml's map but the machine chokes on one in particular, facility.xml, shown below:

65. Simple map question    forum.hibernate.org

I've been banging my head on this problem all day long, as has a co-worker. I have a class, A, which contains a Map. The Map has class B as a key, and value of an Integer (counting how many of class B are required to pass some business rule). Of course, I'd like to persist this map. The end result ...

66. Hibernate mapping    forum.hibernate.org

Hi, Am a newbie to hibernate. I have just created two tables namely Subscriber and Listing. Each Subscriber can have many Listings. Therefore is a one-to-many mapping. Or anoher way round, many Listings belongs to a Subscriber.Tehrefore is a many-to-one mapping. I am actually having a problem of mapping this relationship.either one-to-many or many-to-one. In table Listing, it consist of a ...

67. Mapping interfaces    forum.hibernate.org

Are you saying you have two tables (TABLE_PRINTABLE and TABLE_EXPORTABLE), and you want to map both to a single Java class? Or are you saying that you have a Java class that implements two different interfaces, and maps to a single table (TABLE_DOCUMENT)? In the first case, take a look at joined-subclass element of the Hibernate mapping file (hbm.xml). In the ...

68. Need some ideas on the mapping    forum.hibernate.org

I'm currently writing a web application, that will handle generic objects. So I will have most likely one object with a set of fields, that have a type and a value. I was wondering how to do the mapping. Any ideas? So what I have so far: package org.mendrik.suigeneris.model; import org.apache.log4j.Logger; import org.mendrik.suigeneris.meta.FieldSupport; import org.mendrik.suigeneris.persistence.Dao; import java.util.HashMap; import java.util.Map; /** * ...

69. Problem with interfaces mapping!    forum.hibernate.org

Hi, all I'll try to describe an extract of my class diagram: Class Person: implements Subject and Contactable (that is, a person is a generic subject and is contactable - by mail, telephone, etc.) Class Company: implements Contactable (that is, a company can have a telephone number an fax number etc) Interface Subject. Interface Contactable. Class Contact: this is the implementation ...

70. Mapping many-to-many problem    forum.hibernate.org

Hi!! I'm having a problem and need help (huge help!!). I'll explain the context. Tables (..table names are in spanish... ups!!): Code: TABLE Carrera { id_carrera: PK .... } TABLE Materia { id_materia: PK id_carrera: PK id_departamento: FK .... } TABLE Departamento { id_departamento: PK .... } TABLE Integracion { id_materia: PK id_carrera: PK id_materia_padre : PK } Quote: "id_materia_padre" refers ...

71. one-to-many not mapped when Hiberntae 3.1.2 gets here.    forum.hibernate.org

Beginner Joined: Fri Oct 15, 2004 2:54 pm Posts: 33 Location: Austin, TX I have a one-to-many relationship called stateTokenRecords that is mapped as follows: Code: ...

72. Mapping without classes    forum.hibernate.org

Hi el_coda! I'm not sure I understand your question... are you asking if you could have the hbm.xml file without the class/object that represents the hbm.xml file? if so, as far as I know, you MUST have the class with attributes (the same attributes as in your hbm.xml) so that Hibernate can use it. Hope that helps.

74. hibernate mapping problem    forum.hibernate.org

Newbie Joined: Mon Apr 04, 2005 11:10 pm Posts: 6 Code:

75. Hibernate Mapping - Many to Many -- How to....    forum.hibernate.org

Newbie Joined: Sun Sep 18, 2005 6:34 pm Posts: 12 Hibernate version: 3.1.2 Im trying configure Hibernate to work with some existing data structures and I am having difficultly capturing the following relationship in my Hibernate mappings. My Model is as follows... Table 1 {User}---> contains user information Table 3 {UserGroup} --> contains Usergroup Names Table 2 {Join_Users_to_Usergroup} --> contains relationship ...

76. Problem on using Maps on AS/400 (iSeries)    forum.hibernate.org

Hi, I've got a pretty strange problem using Maps on DB2400Dialect. I've got a very simple component mapping: Code: ...

77. Hpw to Store Map    forum.hibernate.org

If you mean a single line of java code, then that's easy. Just set the appropriate cascade levels in your inverse="false" set/map/list/whatever. If you mean that you want to issue a single SQL insert/update, and have it save everything in one statement, then no, that's not possible. Not all DBMSs support bulk inserts, and very few support bulk updates. Hibernate 3.1 ...

78. Can someone verify my simple mapping configuration?    forum.hibernate.org

I'm still experimenting with Hibernate, and I would really appreciate if someone could provide me some feedbacks on my mapping configuration. My test app has 3 database tables: PERSON, CAR and CARTYPE. The relationship between PERSON and CAR is one-to-many, and CARTYPE to CAR is one-to-many. These are my JAVA bean classes:- Code: Person Table ---------------- Long personId ...

79. complicated mapping problem    forum.hibernate.org

Hibernate version: 3.1 I need to import data only and did not want to use a join to read the data. The problem is I did not managed to figure out a working mapping for my problem. The tables are coming from oscommerce and are IMHO not properly designed. an attribute can have options in multiple languages. So option has a ...

80. mapping problem    forum.hibernate.org

i have a service table which consists of property service_id (primary key), date and service. i have another serviceType table which consists of propert service_id (primary key) and service_description. the question is is it possible to map the service column(service table) with the service_description column (serviceType table) ?? i have do it in this way: service.hbm.xml:

81.  mapping    forum.hibernate.org

Hello, I hope you don't mind me barging into this thread, but I you mentioned that primary keys could be used to link a one-to-one mapping, I have a problem trying to achieve that with a composite id. Could you shine a light on it? I have 2 classes/tables, each with the following composite key and one-to-one definition: ...

82. small problem with mapping    forum.hibernate.org

Hello, friends! I can not uderstand how to use mapping for discribing foreign key: I want to create foregn key as Table1.Id --> Table2.Id. But Table1 has 1 primary key and Table 2 has 2 primary key. Table1 ---------------- Name_Id (PK) ---------------- Id (FK) Table2 ---------------- Id(PK) Parametr(PK) --------------- Col1 Col2 Col3 .. --------------- Could you help me, please!

83. Mapping Question Using Set    forum.hibernate.org

Author Message spurcell999 Post subject: Mapping Question Using Set Posted: Fri Mar 10, 2006 11:09 am Beginner Joined: Thu Dec 15, 2005 12:02 pm Posts: 23 Hello, I have a Users table with a primary key of "user_id". A user may have many passwords. I have a password table with a foreign key of "user_id". I have the mappings ...

84. Accessing hibernate's mapping information    forum.hibernate.org

I would like to access hibernate's mapping information - i.e. what classes are mapped to which tables, their fields and relations, etc. - from within my code. The motivation is to write a custom import module that is supposed to create pojos from imported data. Specific questions I have would be How do I know the class (name) for a given ...

85. Conditionall Mapping    forum.hibernate.org

Hi I've read some posts about this but still got no idea how to do this. I have a proprety in a class that I wish to map to two different columns on a table: the class attribute should assume the value from the one column that is not null (those two columns are never either both null nor not null). ...

86. How 1:1 Mapping into a Single Class    forum.hibernate.org

Hy, got the following situation: Two Database-Tables: 1. loc_entry_history: - "ehid": primary key, auto_increment, unique - "time": Timestamp - "views": int 2. loc_entry_history_info: - "ehid": foreign key on "loc_entry_history.ehid", primary key, unique - "title": String - "plz": String As you can see, this results in a 1:1 mapping between loc_entry_history and loc_entry_history_info. I managed to get the Data into to classes ...

87. Bi-Directional mapping stackoverflow    forum.hibernate.org

88. Mapping Question    forum.hibernate.org

I have to deal with an environment where the Business Objects are meta-data driven. Instead of a 'Customer' class with attributes 'FirstName', 'LastName', etc I have a BIO class [Business Information Object] that is associated with a meta-data object 'Customer' at instantiation time; property values are set via a generic set method such as : void set(String PropertyName, Object value) It ...

89. Mapping question    forum.hibernate.org

The Person object is related to a Person table : 1) PersonPk PK 2) ParentPerson Nulable allowed.. Each person can have a single or no parentperson The parent which is also a person, will be retreived by the method Person getParent() and can be set by setParent(Person) Would a one-to many apply in this scenario .?

90. Mapping problems    forum.hibernate.org

Hi all I have the following situation A database (no write access) has a table A and a table B. Almost every field is similar. Modelling the java classes i ignored this and as everything seemed the same I've taken everything in the same class X. X has 2 sons, Y and Z. Y should map (along with all inherited attributes ...

91. Address Mapping Question    forum.hibernate.org

I'm investigating using Hibernate 3 in an existing application with legacy database. Hibernate seems useful, but our database has many strange constructs that aren't obvious to me how to accommodate using Hibernate. For instance, I have a MEMBER table with a MEMBER_ID PK and an ADDRESS table with a composite (MEMBER_ID, ADDRESS_TYPE) PK. For any member, there may be a mailing ...

92. one-to-one mapping    forum.hibernate.org

I cannot believe that this is so difficult to do in H3. This is so simple in ATG's Dynamo that it is laughable I can't solve this in H3. I have a main table like so: User_info ------------ user_id first_name Last_name And an additional table holding extra "user information" Opt_ins ------------- optin_id user_id newsletter quarterly_mailings The Pojo UserInfo contains a property ...

93. Hibernate Mapping - Cross platform development    forum.hibernate.org

Morning, People. I'm starting with Hibernate 3.0, and I have a doubt. I'm trying to develop a system that could be used in various DB engines (Oracle, MS SQL Server, PostgreSQL, MySQL). I've already read the Hibernate documentation, about mapping the id column in database. I use sequences, in Oracle and Postgre, and auto-increment columns, in MS SQL Server and MySQL. ...

94. Mapping problems with UserTypes    forum.hibernate.org

Hi, I use Hibernate version 3.1 and MySQL 5.0. I wanted to implement an enumeration type and did this by implementing two classes, a ParameterType and the ParameterTypeUserType. In the mapping file of the class using the enum type, I inserted following lines: Now I always get the following error message when running the ant-tasks: build.xml:93: Schema ...

95. Long time mapping during deployment!!!    forum.hibernate.org

96. Problem mapping class with depended class in it...    forum.hibernate.org

Newbie Joined: Tue Mar 28, 2006 10:27 am Posts: 2 Hello, I'm trying to store the following class: Code: public class AlignJob { private int id; private String user,jobName; ...

97. Hibernate mapping question    forum.hibernate.org

Hibernate version: 3.1 Mapping documents: N/A Code between sessionFactory.openSession() and session.close(): N/A Full stack trace of any exception that occurs: N/A Name and version of the database you are using: Oracle 9.2.0.6 The generated SQL (show_sql=true): N/A Debug level Hibernate log excerpt: N/A I have a Hibernate Best Practices question. We have two tables in our application, where the first table ...

98. How to map localized text    forum.hibernate.org

99. Executing mapped stored procedures in Hibernate 3.1.3    forum.hibernate.org

Hello, people. This is my first post to this forum and i hope it will not be the last :) I'm facing a problem trying to call a Sybase stored procedure which receives only one parameter as input and render a recordset to output. When i try to make the call an error is thrown: java.sql.SQLException: JZ0SC: Callable Statement: attempt to ...

100. Mapping question    forum.hibernate.org

Hi, I'm using hibernate v 3.0.5 and I have a mapping question. I have two classes public class DocumentContent { private Document doc; } public class Document { private Set revisions = new HashSet(); // set of DocumentContent private Set drafts = new HashSet(); // set of DocumentContent } How would I map the document class so that it has two ...