1. JPA Cascading Delete: Setting child FK to NULL on a NOT NULL column stackoverflow.comI have two tables: t_promo_program and t_promo_program_param. They are represented by the following JPA entities:
|
2. Hibernate mapping: many to many with fk not having the same name? stackoverflow.comI'm trying to map a many-to-many relationship but my middle table is giving me trouble because the names don't match. table1:
table2:
table3:
Could anyone give me a pointer how ... |
3. How to delete parent entity and set null in child FK column in hibernate? stackoverflow.comHere is example:
|
4. ManyToOne FK column setting forum.hibernate.orgHi, I have a OneToMany relationship between entities Contact and Email. When I create a Contact and add to him 1 or more Email I need to set the FK column in Email table to the right Contact of that email... I tried this: Code: @Entity class Contact{ @Id ...... ... |
5. Managing persist with child FK dependence on parent PK forum.hibernate.orgI'm new to hibernate and trying to navigate some issues. Currently I have multiple tables that contain have a foreign key pointing to the primary key of another table. The primary keys in many cases are auto generated. I'm using MS SQL Server so the database creates the generated key. I'm building the objects up and then performing entityManager.persist on the ... |
6. Problem w/ FK Mapping forum.hibernate.orgI can't figure out what is wrong with my mappings. I'm getting the following Exception: Code: Exception in thread "main" net.sf.hibernate.MappingException: Foreign key must have same number of columns as referenced primary key Start server side stack trace: net.sf.hibernate.MappingException: Foreign key must have same number of columns as referenced primary key at net.sf.hibernate.mapping.ForeignKey.setReferencedTable(ForeignKey.java:33) ... |
7. child relationship on FK; can't figure the hib option to use forum.hibernate.orgUsing Hibernate 2.1, can't figure out solution to parent-child type scenarion: foo FOO_ID PK bar BAR_ID PK FOO_ID SEQUENCE NAME bar_data FOO_ID DATA There is no PK on bar_data (i know, i know). I'm trying to retrieve all bars, where each bar also contains a Set of bar_data objects based on the FOO_ID FK. Taking the bar_data out of the equation, ... |
8. How to map a unidir one-to-one with fk in the opposite tbl forum.hibernate.org |
9. child table column name different from referred fk column forum.hibernate.orghi, I am using hibernate 2.1 with sybase. Suppose I have 2 tables,(simplified to a large extent) parent ====== id int name varchar suppose composite key here is (id,name) child ==== child_id int parent_id int (refers id of parent) name varchar suppose composite key here is (child_id,parent_id,name) the mapping snippet for child is, |
10. How to map strange PK/FK relationship forum.hibernate.orgPosting code and XML snippets may make this question harder than it is, so I'll refrain from doing that. Many of the tables in our database have compound primary and foreign keys. And quite often, the primary key contains a foreign key back to another table. This is all fine until the primary key actually contains two foreign keys back to ... |
11. mapping related objects NOT using PK's, FK's? forum.hibernate.org |
17. Mapping with 2 FK referring to same PK in the other table forum.hibernate.org |
18. Hibernate setting null in child record's FK before deleting forum.hibernate.orgHibernate version: 3.1.2 Mapping documents: [code] |
19. Hibernate mapping FK between Databases forum.hibernate.org |
20. FK violation with forum.hibernate.orgHi everyone, I'm getting an FK violation when trying to insert an entry in a Map, but can't for the life of me figure out why. Could anyone here see what I'm doing wrong? Am I doing something wrong with the |
21. Mapping association defined by (discriminator, FK) pair forum.hibernate.orgHi all, Anyone knows if it's possible to map a combination of (discriminator,FK) that joins to different tables/entities depending on the discriminator value. Notice that here discriminator has nothing to do with mapping hierarchies. It's a discriminator just in the sense that it distinguished between different join tables. For example Review with (targetKind, targetId) where targetKind could be Product or Store. ... |
22. mapping parent-child when child's FK is not the parent's PK forum.hibernate.org |
23. how to map one-to-many using multi-fields as FK forum.hibernate.orgI wonder how to map one-to-many with multi-fields as Foreign Key. Suppose there are two tables: Table1( T1F1 NUMBER PRIMARY KEY, T1F2 NUMBER ) Table2( T2F1 NUMBER PRIMARY KEY, T2F2 NUMBER, T2F3 NUMBER ) For Table1, I don't want to use composite key as the primary key. Although T1F2 is not the the PK of Table1, I need to use it ... |
24. Is it possible to map a FK column as an id property ? forum.hibernate.orgNormally, a many-to-one column is mapped to a Java object of the mapped class, for example: Code: @ManyToOne(targetEntity = Reason.class) @JoinColumn(name = "reason_code", nullable = false) private Reason reason; Is there a way to map this column to a simple integer/long Java property containing only the ID of the mapped row? (The reason for this 'strange' question ... |
25. FK property on child class in many-to-one forum.hibernate.orgI have two classes, Parent and Child: Code: public class Parent { private Integer parentId; private List |
26. ERR: miltiple FK in the Child table to a single PK in Parent forum.hibernate.org |
27. PK/FK mapping issue forum.hibernate.orgHi, I have 2 tables with Parent to Child relationship of one to many. Parent (A): col_1 (Generated PK from a sequence) col_2 ... Child (B): col_1 (PK and FK from A) col_3 (PK) col_4 ... I have used cascade="all" in parent After making the object, when i do the saveOrUpdate, the child is getting null value for col_1. I did ... |
28. Parent's Composit PK as FK in child shows insert problem forum.hibernate.orgHi folks, I am having dificutlies when I insert a new record in child table. actually I have parent table PROFILE which has composite key profile_id and user_id and there is child table EDUCATION which has this composite key as ForeignKey. When I am trying to insert a child record in EDUCATION table its shows error "You have an error in ... |
29. Mapping single table with many FK ref to another table forum.hibernate.orgI have a table that contains contacts (think people) and another table that contains information about a system and who is responsible for aspects of the system (think owner, project manager, sys admin, etc) Each system row has a column for each designated responsibility which holds a Foreign Key reference to the contact tables Primary Key that represents the appropriate contact ... |