relation 6 « Map « JPA Q&A





1. One to many relations in queries    forum.hibernate.org

Newbie Joined: Mon Mar 10, 2008 11:55 am Posts: 8 Hi @ all, Hope anybody can help me. I have a table "pref_language" with all possible languages (currently german and english). Furthermore I have table "pref_Translations" with all translations of an issue in example "table" for english and "Tisch" for german. pref_language Code: pl_id pl_name ...

2. Problem in Hibernate many-to-one Foreign key relation    forum.hibernate.org

Hi to all I am trying Hibernate many-to-one association for foreign key relation for two tables.but i am getting the following error org.hibernate.MappingException: An association from the table contact_bh refers to an unmapped class: Contact_rvBean can any one solve this My code-- First table: contact_rv PID NOT NULL NUMBER(38) PNAME VARCHAR2(50) Second table: contact_bh EMPID NOT NULL NUMBER(38) PID NUMBER(38) I ...

3. Problem in Hibernate many-to-one Foreign key relation    forum.hibernate.org

Hi to all I am trying Hibernate many-to-one association for foreign key relation for two tables.but i am getting the following error org.hibernate.MappingException: An association from the table contact_bh refers to an unmapped class: Contact_rvBean can any one solve this My code-- First table: contact_rv PID NOT NULL NUMBER(38) PNAME VARCHAR2(50) Second table: contact_bh EMPID NOT NULL NUMBER(38) PID NUMBER(38) I ...

4. Problem in Hibernate many-to-one Foreign key relation    forum.hibernate.org

Hi to all I am trying Hibernate many-to-one association for foreign key relation for two tables.but i am getting the following error org.hibernate.MappingException: An association from the table contact_bh refers to an unmapped class: Contact_rvBean can any one solve this My code-- First table: contact_rv PID NOT NULL NUMBER(38) PNAME VARCHAR2(50) Second table: contact_bh EMPID NOT NULL NUMBER(38) PID NUMBER(38) I ...

5. Problem in Hibernate many-to-one Foreign key relation    forum.hibernate.org

Hi to all I am trying Hibernate many-to-one association for foreign key relation for two tables.but i am getting the following error org.hibernate.MappingException: An association from the table contact_bh refers to an unmapped class: Contact_rvBean can any one solve this My code-- First table: contact_rv PID NOT NULL NUMBER(38) PNAME VARCHAR2(50) Second table: contact_bh EMPID NOT NULL NUMBER(38) PID NUMBER(38) I ...

6. Problem in Hibernate many-to-one Foreign key relation    forum.hibernate.org

Hi to all I am trying Hibernate many-to-one association for foreign key relation for two tables.but i am getting the following error org.hibernate.MappingException: An association from the table contact_bh refers to an unmapped class: Contact_rvBean can any one solve this My code-- First table: contact_rv PID NOT NULL NUMBER(38) PNAME VARCHAR2(50) Second table: contact_bh EMPID NOT NULL NUMBER(38) PID NUMBER(38) I ...

7. Hibernate relation mappings    forum.hibernate.org

...

8. Delete entity with relations    forum.hibernate.org

Hi, Yeap, I've tried with this option which just run fine, when deleting entities by entities. But what I want to achieve here is to do a bulk delete of entities and I'm just wondering if other association would be also deleted (if it's a behaviour I can except from Hibernate). One way I could fix this is apparently by using ...

9. Finding a good way to delete elems from manytomany relation    forum.hibernate.org

Author Message albert.sole Post subject: Finding a good way to delete elems from manytomany relation Posted: Wed Mar 19, 2008 11:21 am Newbie Joined: Thu Feb 21, 2008 8:39 am Posts: 15 I have a many to many relation, map as the DATABASE SCHEMA (see below) describes. In the database, I have three tables, one for clients, one for ...





10. Criteria and one-to-many and many-to-many relations    forum.hibernate.org

List contact = session.createCriteria(T1.class) .createAlias("T2", "t22") .createAlias("T3", "t33") .add(Restrictions.eq("t22.property", "value")) ...

11. N:M:K Relation, N:M Relation with 3 tables    forum.hibernate.org

I would be interested on the answer to your question. I am a newbie with Hibernate but I think I will need to model something similar in my next project. I am assuming that you have something similar to the following: Lets assume 3 entities: Person, Pet and House and you want to model that a person can own multiple houses ...

12. One-To-Many relation, nullable=false doesn't work    forum.hibernate.org

Althought I tried to find a solution in this forum, I can't make it run. What I want to do is to build a simple one-to-many association between the two entities: malfunction and activity, where 1 malfunction can have 1:n activities. I want to manage the creation, update, etc. from the parent (malfunction). Here my code: Code: Malfunction.java ...

13. Mapping of a phys.l 1:n onto a logical 1:1 relation possbl.?    forum.hibernate.org

Hello! We are currently using Hibernate 3.2.4. We have the following mapping question: We have three objects types/tables: Type A: Some business object Type B: Some depending business object Type C: Some table that defines time slices. A, B and C have normal primary keys, A and B also have logical keys that mark object of some logical indentity for different ...

14. Problem in Foreign Keys in a simple one to many relation!    forum.hibernate.org

Newbie Joined: Fri May 16, 2008 2:36 am Posts: 2 I am a newbie to Hibernate so please forgive me if this kind of question was asked on the forum before. I tried to find a similar post but was not successful. What I am trying to do: I am trying to implement a one-to-many relationship using an owner and accounts ...

15. Mapping many-to-many relations with data in the relation tab    forum.hibernate.org

...if you want composite PK... @Entity @IdClass(CategoryTranslationId.class) public class CategoryTranslation @Id @Column(insertable=false, updatable=false) private Long category_id; @Id @Column(insertable=false, updatable=false) private Long translation_id; @ManyToOne @JoinColumn(name="category_id", insertable=false, updatable=false) private Category category; @ManyToOne @JoinColumn(name="translation_id", insertable=false, updatable=false) private Translation translation; //... you will need to implement idclass, but that's trivial maybe it's smarter tho to add semantics-free PK

16. Foreign key not saved in one-to-one relation    forum.hibernate.org

I have two tables: option_position and stock_trading. The relation is one option_position contains one stock_trading. Here is the def: Table option_position: id -- primary key, auto increment Table stock_trading: id -- primary key, auto increment option_position_id -- foreign key to option_position table Here is the OptionPosition.hbm.xml:





17. Friendship relation and ManytoMany mapping    forum.hibernate.org

Hi, I'm trying to implement a friendship relation using a join table. However, this is slightly different from other cases in examples on two perspectives: 1) Friendship is in his nature a bidirectional relationship. Code: A friend of B => B friend of A 2) No another table to join, it joins on itself Without forgetting ...

18. Many to many save and delete relation table only.    forum.hibernate.org

Hi guys, I am learning hibernate and SWT so I am wirting home application for movies. So my problem. I have three tables. t_movies id ...... r_movie_actor id_movie id_actor t_actor id ...... eclipse plugin generate for me this code. t_movie Code: .... ...

19. Mapping a join relation    forum.hibernate.org

Hello. I have problems writing my mapping file. Here is my situation : I have a table T_CONTRACT and a table T_CLIENT. T_CONTRACT is containing an id of T_CLIENT (representing the subsriber). I would like to make a join between those 2 table so that i can get something like Code: Contract ct = ContractDAO.findById(1); Client cl = ct.getFkSubscriber(); so far, ...

20. Help on one-to-many relation.    forum.hibernate.org

Hi All, I am new to hibernate. We have a DB like this. Companies ======== company_id(PK), parent_company_id, status, ... User ===== user_id(PK), company_id, .... contacts ====== contact_id, firstname, lastname, companyname, ref_object_id, ref_object_name, ..... Contact information for company or user will be stored in contact table with respective primary key values in "ref_object_id" column and table name in "ref_object_name" column of the ...

21. How mapping this relation with annotations    forum.hibernate.org

Table A id_a int, name varchar(30), primary key(id_a) Table B id_b int, name varchar(30), primary key(id_b) Table Version id_version int, discriminator char(1) in ('A','B'), id_entity int, primary key(id_version, discriminator, id_entity) Table Version holds versions of a's and b's items in column id_entity. Each class (a and b) have a list of versions. Table A id_a name 1 'aaaa' 2 'aaa' Table ...

22. combining two one-to-many relations    forum.hibernate.org

I have a situation in which I have a many-to-many relation split up in two one-to-many relations using a join table. Normally, each id of the join table referes to some unique entity. For example; Blog - BlogUser - User After setting up the relations in Blog and User, you can ask a Blog for its collection of users, and inverse, ...

23. Problem deleting child one to many relation JPA w/merge    forum.hibernate.org

Problem Basically i have a One to Many relationship that works fine for create and add childs, but when i try to remove childs it throws this error, i'm using JPA Hibernate implementation. Hibernate version: Hibernate-Version: 3.2.6.ga Product: Hibernate EntityManager Version: 3.3.1.GA Spring-Version: 2.0.8 Mapping documents: Coupon(One Side) ... @Entity @Table(name = "COUP_DTL") public class Coupon implements Serializable { /** * ...

24. Data Insert Problem in One to Many Table Relation Ship    forum.hibernate.org

Hi There, Iam new to Hibernate , i have 3 tables which is pointing to a single master table .when i enter data to one child table null records is getting created to other child tables, hope the explanation below will help all of you to understand the problem. EDUORG - > STUDENT - > TEACHING STAFF -> NON-TEACHING STAFF EDUORG ...

26. Severe SQL Syntax Error when persisting object relations    forum.hibernate.org

Newbie Joined: Tue Sep 16, 2008 11:10 am Posts: 7 Hello, I'm trying to persist two objects that present a many-to-many relation. When persisting them individually there are no problems, but when I include the references in both, I receive the expection I report below. I double checked all the mapping and the code but there is something I must be ...

27. How to get field names from relation (MySQL DB)    forum.hibernate.org

28. Problem with 1:n-relation    forum.hibernate.org

Hi everybody, there is a 1:n-relation between my classes Person and City. I get the following error: org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of de.waldhausweg7.model.City.persons org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:104) org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:337) org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:200) org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3566) org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:129) org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854) org.hibernate.loader.Loader.doQuery(Loader.java:729) org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) org.hibernate.loader.Loader.loadEntity(Loader.java:1860) org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48) org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42) org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3044) org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:395) org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:375) org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139) org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:179) org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103) org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878) org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:846) org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:557) org.hibernate.type.EntityType.resolve(EntityType.java:379) org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:116) org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854) org.hibernate.loader.Loader.doQuery(Loader.java:729) org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) org.hibernate.loader.Loader.doList(Loader.java:2220) org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) org.hibernate.loader.Loader.list(Loader.java:2099) org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289) org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695) org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142) org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152) de.waldhausweg7.service.PersonService.getPersonList(PersonService.java:136) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ...

29. Mapping User-Friends relation in Social Networks    forum.hibernate.org

It's quite some time that I'm trying to figure out this problem and from googling around many people have similar problems. I'm trying to model a User in a Social Network, and what is more basic to a social network than to map a friendship relation? Every user in the system should have a list of it's friends and I thought ...

30. Non obligate many to one relation    forum.hibernate.org

Hello everybody, I'm learning Hibernate for the moment, and I've envountered a question which i cannot answer. For a personal project, i'm developping an Animal Store, It has simple mapping, but one thing is not clear to me. There are three object classes: The store itself, which has animals: Code: @Id @GeneratedValue(strategy=GenerationType.AUTO) ...

31. Problems with second level cache (EH),parent child relations    forum.hibernate.org

Problems with second level cache (EH), Newly created child object is not added to parent's (which is in second level cache) collection of child objects. I am facing problems with second level cache(EH), I am creating child object using session.save(childObj). After closing the session, I am opening a new session and retrievig parent object through it. But the collection in the ...

32. Inheritance with one-to-many relation    forum.hibernate.org

Hi, I have a Parent class and two children - ChildA and ChildB - classes. I need to map these to three tables - PARENT, CHILDA and CHILDB. PARENT to CHILDA is an optional one-to-one relation. PARENT to CHILDB is an optional one-to-many relation. I am able to map ChildA with a joined-subclass, and it works fine. How do I map ...

33. [Solved] Query and many-to-many-relation    forum.hibernate.org

Hello, in my application, there are the classes Person and Category with a many-to-many-relation between them. Now I want to select all persons with categoryId = 1. I have been trying to create this query for hours, but it does not work. Can someone explain me how to write this query? Here are the relevant parts of my mapping files. Person.hbm.xml ...

34. Relation Mapping only for EntityMode.MAP    forum.hibernate.org

Hi, I'm looking for a way to declare a one-to-many relation for an entity without storing the value (the Collection) in the entity. no member, no getter, no setter. I have not found a way to do so without getting an Exception like "org.hibernate.PropertyNotFoundException: Could not find a getter for (...)" This may sound like not really useful, but I need ...

35. Annotate listener relations    forum.hibernate.org

Hi, I have a problem of how to persist listener relations. in a model that has versatile objects that fire events, and versatile objects that listen to those event, how can i persist all the relations? my basic method for listening is to create a listener interface with the needed methods, and have any object who want to listen to implement ...

36. Remove and Delete don't work in Many-to-Many relation    forum.hibernate.org

Hello everybody! I'm a beginner in Hibernate, so excuse me if i'm not specific enough in my explanations. So, like it's mentionned in the title of the topic, in Many-to-Many relation delete and remove don't work. I have the following relationship between: A <---> B M:N The entity A contains a set of objects and idem B contains a set ...

37. How to model a symmetric self-referencing relation?    forum.hibernate.org

Hi, I am trying to model a friendship relation between User entities. My initial impression was that this should be modeled as a bidirectional m:n relation, much like a parent-child self-reference. But in this case, the roles on both sides of the relation are the same. In the database schema, I have a join table that basically consists of (user1_id, user2_id). ...

38. How to model a symmetric self-referencing relation?    forum.hibernate.org

Hi, I am trying to model a friendship relation between User entities. My initial impression was that this should be modeled as a bidirectional m:n relation, much like a parent-child self-reference. But in this case, the roles on both sides of the relation are the same. In the database schema, I have a join table that basically consists of (user1_id, user2_id). ...

39. Hibernate Query that doesn't return One-Many relation objs    forum.hibernate.org

I have JPA entity (Object A) with a One-Many owning relationship (Object B) in an ArrayList. I want to be able to query for Object A without having any of the instances of Object B returned (proxies or otherwise) in the One-Many ArrayList. Is this possible? In rough pseudocode this is what I want: "from ObjectA where ObjectA.id=5 DO NOT INCLUDE ...

41. SQLState: 42P01 ERROR: relation "XXXX" does not e    forum.hibernate.org

Newbie Joined: Sat Feb 21, 2009 12:30 am Posts: 7 I am trying to get a very basic example from the book "Professional Hibernate" working. When I solve one problem, another pops up. But here is one I cannot figure out. I have seen several similar posts, but no real solutions or even ideas that point one in the correct direction. ...

42. Error while updating a entity with one-many relation    forum.hibernate.org

Hi, I am using Hibernate with JPA support in my application. I am facing a problem in update operation which is given below, I have two Enitity objects named SearchProfile and SearchCriteriaAssociation. for two tables [u] [b]Search_Profile[/b][/u] SEARCH_PROFILE_SEQNO - Number, (PK) SEARCH_PROFILE_NAME - varchar SHORT_DESCRIPTION - varchar [u][b] Search_Criteria_Association[/b[/u]] SEARCH_PROFILE_SEQNO - Number, (PK) SELECT_CRITERIA - varchar (PK) SELECT_VALUE- varchar SearchProfile has ...

43. Duplicate Roms in Many to Many relation    forum.hibernate.org

Newbie Joined: Wed Mar 04, 2009 2:02 pm Posts: 4 Hi, I have I problem and don't even know how to google it. The fact is that I have a Class A than contains a ManyToMany relation with class B and a oneToMany relation with a Class C. When I try to get the class with non-lazy(querying A to have both ...

44. mapping a m2m unidirectional relation as m-1    forum.hibernate.org

Hibernate Core Version Hibernate 3.3.1.GA Hibernate EntityManager 3.3.2.GA Mapping documents: Code: class Version { @Id private Integer id; @Column(name="version_name") private String versionName; } class File { @Id private Integer id; @Column(name="file_name") ...

45. Saving a Many to Many relation    forum.hibernate.org

Newbie Joined: Mon Mar 09, 2009 11:21 am Posts: 11 My Problem is as follows. I have a many to many assosiation between environments and servers. It all seems to be fine, I get no error if I want to save some data (see Java Code below). But my relation table (ecm_server_environment_data) contains no Data! Server and Environment Entities are saved ...

46. Duplicate rows in a many to many relation    forum.hibernate.org

Hi, I'm having an issue with a many-to-many relation. I have 2 tables, PLAYER, and CARD. A party, can have several cards. A card, can be played by several players. So far, a basic many-to-many relation if I'm not mistaken. But! and here is my problem, a player can have several times the same card. So, when I create my many-to-many ...

47. How to delete a manytomany relation to the same entity?    forum.hibernate.org

@ManyToMany @GenericGenerator(name = "gg1",strategy = "increment") @CollectionId( columns = @Column(name = "ID"), type = @org.hibernate.annotations.Type(type = "long"), generator = "gg1" ...

48. Executing Query on Many-to-Many relation ship table    forum.hibernate.org

I am using JPA and I have two entities A and B , and those are having Many-To-Many relationship.When I deploy the application a new table A_B(mapping table) is created automatically.When I tries to execute a Query on this table I got an error like A_B doesn't mapped.Can't we run the em.createQuery("UPDATE A_B SET name='robert' "); thanks Srinivas.

49. [JPA] @ManyToOne relation problem    forum.hibernate.org

Hibernate version: Hibernate Annotations 3.4.0 GA Name and version of the database you are using: Oracle 10i Hi, I have a dilemma: + I have 2 entities with a ManyToOne relationship and no unique ids (Embedded ids): Entity A (date, field1, field2) Entity B (field1, field2, startDate, endDate) + Primary key of Entity B is an embedded id composed by field1, ...

50. One to One relation generates outer join    forum.hibernate.org

Hi All, I have the following mapping in hibernate. When I do a Session.load for Subscriber object. It always return the following SELECT subscriber0_.SubGuid as SubGuid30_2_, subscriber0_.FirstName as FirstName30_2_, subscriber0_.Version as Version30_2_, account1_.SubscriberId as Subscrib1_31_0_, account1_.Amount as Amount31_0_, address2_.SubGuid as SubGuid32_1_, address2_.FirstLine as FirstLine32_1_, address2_.Version as Version32_1_ FROM dbo.Subscriptions subscriber0_ left outer join dbo.Accounts account1_ on subscriber0_.SubGuid=account1_.SubscriberId left outer join dbo.Addresses ...

51. Problem with ManyToMany relation    forum.hibernate.org

52. Possible to map an 1:n relation on the n (not in code) side?    forum.hibernate.org

Hi, if I map a 1:n relation on the 1-side, I will get an Jointable as Databasetable. Which I would prefer, cause of performance issues, is to map it on the n-side, without changing my java code. (unidirectional relation instead of bidirectional) So on the n-side of the relation there is no attribut present, so no foreign key attribute is present ...

53. many lazy OneTo* relations on one Entity expensive?!    forum.hibernate.org

Page 1 of 1 [ 4 posts ] Previous topic | Next topic Author Message dukehoops02 Post subject: many lazy OneTo* relations on one Entity expensive?! Posted: Wed May 20, 2009 4:28 pm Beginner Joined: Thu Apr 13, 2006 12:56 pm Posts: 23 I have a User entity that has 20 ...

54. one to many relation    forum.hibernate.org

Newbie Joined: Thu Jan 22, 2009 1:53 am Posts: 5 my environment;myeclipse 7, hibernate 3, spring 2.5 tables;product , product_category, category(one to many, many to one relationship) I generate DAO of three tables using hiberante reverse engineering. I can not see product_category table. i don't know why? how can i generate product_category table, without product_category table , product.hbm has an error ...

55. Problem with self referencing one-to-many relation    forum.hibernate.org

I have following object structure: An abstract class InvolvedObject with subclasses InvolvedParty and InvolvedItem. The idea is to have a one-to-one parent relation form InvolvedObject to InvolvedObject and also a one-to-many relation to the children of type InvolvedObject (so self referencing, bi-directional). The inheritance strategy is found best to be JOINED (one 'shared' super table and one table per subclass). (Non ...

56. Multiple one-to-many relations    forum.hibernate.org

I have very simple object structure for Person's and their marriage relations. I have exactly same structure in the db as well. (The code is in C# but you can ignore that) Code: public class Person { public string Id { get; set; } public ISet MarriageRelations { get; set; } } public ...

57. Mapping one-to-many relation    forum.hibernate.org

Hi, The table TPS16_CONFIGURATION has one-to-may relation TPS25_CURRENCIES_DIFFMIN. The table TPS25_CURRENCIES_DIFFMIN has this primary key: TPS16_ID, TPS25_ISO_CURRENCY where TPS16_ID is the field TPS16_NAME of the table TPS16_CONFIGURATION in particular this field is the key of TPS16_CONFIGURATION. TPS25_ISO_CURRENCY is another field of TPS25_CURRENCIES_DIFFMIN. The pair TPS16_ID, TPS25_ISO_CURRENCY is the key of the table TPS25_CURRENCIES_DIFFMIN. Now there are my problems how can I ...

58. many to one relation org.hibernate.TransientObjectException    forum.hibernate.org

Hi, I using Spring and hibernate and when i try to save a detached object which has many to one relation with the other class, I get org.hibernate.TransientObjectException I am new to hibernate, so please correct me if i am wrong. Employee class Code: public class Employee implements Serializable { private long EPMST_EMP_ID; ...

59. @ManyToMany relation table empty (newbie)    forum.hibernate.org

Hibernate 3 I have two entities User and Role which holds a bidirectional relationship. Basically I want to create as many roles as I want, without the need to add any user to it, but every time a new user entity has to become persistent it must belong at least to a role. User.class ... // many-to-many bidirectional @ManyToMany(fetch = FetchType.EAGER, ...

60. One to Many Chain relations    forum.hibernate.org

61. One to Many Chain relations    forum.hibernate.org

62. Insert a record in Child after Parent - One to Many relation    forum.hibernate.org

Author Message luthriaajay Post subject: Insert a record in Child after Parent - One to Many relation Posted: Tue Jul 21, 2009 10:34 am Newbie Joined: Mon Jul 13, 2009 7:47 am Posts: 4 a).I have a Trade object which can have multiple status's. One-to-many relation Code: ----------------------------------------------------- Trade ...

63. Weak Association, Optional Entity Relation By Foreign Key    forum.hibernate.org

I have a use-case that calls for a weak association. Consider a domain object M and another domain object V. The life-cycle of these objects are completely independent. V wants to "monitor" M, but it allowable for M to be deleted while being monitored by V. We are using JPA annotations and using Hibernate to generate our schema. Using any kind ...

64. Inheritance Mapping:For tables which don't have a relation    forum.hibernate.org

Hi All, I have two tables within same schema which don't have a relationship at all. Say, it's User(ID,loginName,Pasword,etc..) and Customer(ID,country,etc..). Here, In order to obtain the loginName, pasword, for a customer who have ID 1 we need to look for user who have the ID 1(In the User table). Currently this is done by means of stored procedures. In my ...

65. manyTomany self relation problem (ORA-00918: column ambig)    forum.hibernate.org

hi i have a class named Activity it has a many to many self relation my annotation is as fallow: @Entity @Table(name = "Activity") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.STRING) @javax.persistence.SequenceGenerator( name = "SEQ_Activity", sequenceName = "SEQ_Activity", allocationSize = 1) public class Activity implements Serializable { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_Activity") @Column(name = "id") private Long ...

66. hibernate criteria with relations    forums.oracle.com

Hi, I'm trying to make a criteria in hibernate or sql/hql query, but I don't succeed. This is the situation: there are 2 tables: A and B with a 1:n relationship (so A can have multiple B's). In B there is a foreign key to A (FK_A_ID, so with the ID of A) and a date field. I would like to ...