self « Map « JPA Q&A





1. Self-reference entity in Hibernate    stackoverflow.com

I have an Action entity, that can have other Action objects as child in a bidirectional one-to-many relationship. The problem is that Hibernate outputs the following exception: "Repeated column in mapping for ...

2. Hibernate self table many-to-one with join table mapping    stackoverflow.com

I have a brain cramp trying to figure this mapping out. Here's my db:

CUSTOMER              CUSTOMERFAMILY     ...

3. JPA: Self Join Relational Mapping    stackoverflow.com

I have the following classes (attributes in brackets):

  • Form (formElements[]:FormElement)
  • FormElement
  • Question extends FormElement
  • TextBox extends Question
  • SelectBox extends Question
  • Container extends FormElement (childElements[]:FormElement)
I'm using JPA to persist my objects to a relational database. So far I've managed ...

4. Hibernate self ManyToMany save problem    stackoverflow.com

I have a class Node Node.java

public class WebPage implements BusinessObject {
  @Id
  private Long       id;
  @ManyToMany
  @JoinTable(name = "childnodes")
  private ...

5. Self ManyToMany with additional columns using JPA 2.0    stackoverflow.com

I want to create kind of "Friendship" relation between Users models. I also need an additional columns for every friendship. I know I need to use joining class with composite primary ...

6. Self ManyToMany with additional columns using JPA 2.0    stackoverflow.com

I have Application entity, want to express self bi-directional relationship with attribute in JPA. EX. QuoteStore(provider Application) provides services to online portal and many(consumer applications) and QuoteStore(consumer Application) consumes services from Siebel CRM ...

7. Self-Reference One-to-One mapping in Hibernate    stackoverflow.com

I have a class A which has a property type indicating whether it is a receipt or a delivery. A receipt can be mapped to a single delivery and vice-versa. Now ...

9. JPA mapping of Self referenced class    coderanch.com

Hi, I have this self referenced class mapped with JPA annotations. When I declared the property that will contain the children elements of this object as a Set, it works fine. When I declare it as a Collection, I get the following error: Exception Description: An incompatible mapping has been encountered between [class br.com.pedra.softbudget.domain.Category] and [class br.com.pedra.softbudget.domain.Category]. This usually occurs when ...





10. mapping self referencing class    forum.hibernate.org

Hi I'm new to Hibrenate and i'm having trouble mapping the following case (using annotations) : I have a table holding a list of folders - each referencing a parent folder : User_folders : Folder_id integer, Folder_name varchar2(30), Parent_folder_id integer Folder & Parent folder are of the same class. I'm trying to create the following mapping : In the UserFolder class ...

11. Self one-to-many mapping?    forum.hibernate.org

Hi folks, I just start trying to use Hibernate, overall it's very impressed me ;-) I have a question though, in case I want to develop a shopping cart application, and I have a Category class that contain a set of Category classes to form sub-category. How can I map this into Hibernate? Category <1------*> Category

12. mapping self    forum.hibernate.org

Hi I have a table like the following table statefromto with following columns and data statefrom---------stateto Unissued Unissued Unissued Issued Issued Quoted Issued Cancelled What i would like to do is as follows. It need to be mentioned here that the primary key here is a combination of the the two columns. What i would to do is when i use ...

13. optional to-One relationship to self, mapping question.    forum.hibernate.org

Newbie Joined: Wed Jun 30, 2004 11:00 am Posts: 7 I'm just getting started with Hibernate (Version 2) and successfully created mapping files and .java source files for my entities. I just have a question about one of the relationships in my model. I'm not sure the relationship is mapped properly. For a little context, I'm writing web forum application. My ...

14. Self-referential many-to-many mapping    forum.hibernate.org

15. Mapping for self-made IdentifierGenerator Implementation    forum.hibernate.org

First - thx for the early reply! assuming my IdentifierGenerator has the fully qualified classname com.domain.MyIdentifierGenerator you would really write the following mapping: ... In my understanding class denotes the generator strategy from a predefined set of values {native, identity, sequence, increment, .... } could you please confirm this, because ...

16. 1:m parent:child relationship with self    forum.hibernate.org

Reading through the hibernate material a parent:child 1:m relationship is typically mapped wtih a Parent domain class and a Child domain class (no problem). What I want to do is map a single domain object to iteself in a parent:child relationship. For example a fourm that may have a root 'content' item which may have associated child content replies. I want ...





17. Parent-child self join mapping problem    forum.hibernate.org

Newbie Joined: Mon Dec 18, 2006 4:12 am Posts: 1 Hibernate version: 3.2 Name and version of the database you are using: Oracle9 Hi! I'm trying to build a parent/child hierarchy. The actual "object" is mapped to the table CI while the table CI_STRUCTURE holds the parent-child relations. All works fine (ok, not all because then I wouldn't be writing...) and ...

18. Mapping self reference including inheritance    forum.hibernate.org

Author Message olivergierke Post subject: Mapping self reference including inheritance Posted: Thu Jan 31, 2008 4:17 pm Newbie Joined: Thu Jan 31, 2008 2:55 pm Posts: 2 Dear developers, I have a project aiming to use standard JPA data access technology. We're evaluating certain persistence providers right now and have been trying ToplinkEssentials already. As it shows some flaws ...

19. self referencing many-to-many collection mapping    forum.hibernate.org

Hi to all! Just got a delete problem with collection mapping of a self referencing entity. For the many-to-many relationship we are using a database view called 'virtual_dir_map' as the middle table. We are using this view to hide some complex parent-child relationships. If I delete a 'Directory' object, Hibernate try to delete the corrosponding entry in the view too. Since ...

20. Query help with a self-referencing parent/child relatioship    forum.hibernate.org

Im looking for assistance in finding an efficient way to store and access hierarchal objects in Hibernate. I have a class Post, Post has a List of other post objects. The Post class has a body, children, id, parentId and rootId fields. When I store these in the DB I have a single table called Post which has columns for Body, ...

22. Parent - Child, self referencing table    forum.hibernate.org

Hi, I don't seem to get near a solution, so can someone tell me why this isn't working? I have a Channel class that looks like this: Code: ... @Id @GeneratedValue(generator = "channel-id") @GenericGenerator(name = "channel-id", strategy = "increment") public Long getId() { return id; } ... @ManyToOne @JoinColumn(name = "parent") public Channel getParent() { ...