1. Need an example of a primary-key @OneToOne mapping in Hibernate stackoverflow.comCan somebody please give me an example of a unidirectional @OneToOne primary-key mapping in Hibernate ? I've tried numerous combinations, and so far the best thing I've gotten is this :
|
2. @OneToOne getting returned as ManyToOneType stackoverflow.comI have the following POJO:
|
3. Can a @OneToOne relationship contain a @ForiegnKey annotation stackoverflow.comDoes it make sense to have a @OneToOne member contain a @ForiegnKey annotation.
|
4. @OneToOne annotoation problem (i think...) stackoverflow.comim new in hibernate and JPA and i have some problems with annotations. My target is to create this table in db (PERSON_TABLE with personal-details)
|
5. Unable to cascade delete a @OneToOne member stackoverflow.com
I have the ... |
6. Deleting from table with @OneToOne annotation stackoverflow.comI'm using JPA2 and Hibernate implementation. I've got simple mapping like this :
|
7. Problem with bi-directional @OneToOne stackoverflow.comI have 2 entities Customer & Adress as follows: Customer.java
|
8. remove related @OneToOne automatically in JPA stackoverflow.comI'm using the following in JPA:
|
9. @OneToOne + Table-per-Concrete-Class = exception? stackoverflow.comI'm new to Hibernate, and I can't get |
10. Hibernate @OneToOne mapping with reverse reference and CascadeType.ALL on owner does not persist the child stackoverflow.comWe have the following entity relation ship. User is the parent entity.DistrictUserDetail is the child.
|
11. JPA @OneToOne with Shared ID -- Can I do this Better? stackoverflow.comI’m working with an existing schema that I’d rather not change. The schema has a one-to-one relationship between tables Person and VitalStats, where Person has a primary key and VitalStats ... |
12. org.hibernate.AnnotationException: @OneToOne or @ManyToOne on |
13. Hibernate @OneToOne with superclass, only retrieve superclass fields on join stackoverflow.comI have mapped my inheritance hierarchy in Hibernate using InheritanceType.Single_Table and discriminator columns to distinguish between the different entities. All subclasses of the superclass store their fields into secondary tables. As ... |
14. Want to Solve Problem with @OneToOne relationship with JPA-Hibernate? coderanch.comWant to Solve Problem with @OneToOne relationship with JPA-Hibernate? I Have 2 tables 1. Plan -- plan_id(pk) name plan_date 2. Plan_Details -- plan_details_id (pk) -- area -- root -- plan_id (FK) ref to plan table How to declare in this way in JPA only? This is my project requirement? Please any budy help me to get out this probe? Thanks. |
15. @OneToOne(cascade=CascadeType.PERSIST) forum.hibernate.orgHi. I have the following Code: create table users ( user_name varchar(75) not null primary key, user_pass varchar(75) not null ); CREATE TABLE `person` ( `personId` int(11) NOT NULL auto_increment, `name` varchar(75), `user_name` varchar(75) not null, PRIMARY KEY ... |
16. Property name case when using @OneToOne(mappedBy) forum.hibernate.org@Entity public class Foo implements Serializable { @OneToOne(cascade={CascadeType.REMOVE,CascadeType.MERGE}) @JoinColumn(name="Bar_FK") @LazyToOne(value=LazyToOneOption.FALSE) public XYZBar getXYZBar() { ... } } @Entity public class XYZBar implements Serializable { @OneToOne(mappedBy="XYZBar") @LazyToOne(value=LazyToOneOption.FALSE) public Foo getFoo() { ... } } ... |
17. Using @SqlResultSetMapping to "eager fetch" @OneToOne props forum.hibernate.orgI'm using Hibernate annotations to execute a stored procedure in SQL server and I want to use @SqlResultSetMapping to have the results returned as a collection of entities. What I'm trying to accomplish is have each member of the result set be a single instance of my Java class, with that classes properties that map to @OneToOne relationships populated by other ... |
18. is @OneToOne Always Eager fetch forum.hibernate.orgThe entity mapped as @OneToOne is loading always eagerly even though we did fetchType=Lazy if i do optional =true then its not loading when i load parent entity but problem is that i can load it lazily whenever i need in transaction . i can do join fetch of that entity but what if such entity is really huge bacame performance ... |
19. @PrimaryKeyJoinColumn, @OneToOne, and @id forum.hibernate.orgI want to have a dependent object share the primary key of its parent. I.E with tables Table Parent int PARENT_ID // primary key String NAME Table Child int PARENT_ID // primary key, same as parent's primary key String NAME I read somewhere that hibernate allows the @Id annotation with a @OneToOne annotation (Is this only with a newer version of ... |
20. @Id and @OneToOne forum.hibernate.org@Entity public class Customer implements Serializable { @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name="passport_fk") public Passport getPassport() { ... } @Entity public class Passport implements Serializable { @OneToOne(mappedBy = "passport") public Customer ... |
21. @OneToOne forum.hibernate.org//EDIT: Solved! Damn. I justed missed to set up the cascadeType....Now it works. Thank you anyway. Hello, I'm totaly frustrated. I have no idea what's wrong. I hope somebody can help me. I am trying to build a simple OneToOne relationship between the tables "address" and "customer". Unfortunately it doesn't work and I got the messages: 10:02:56,129 DEBUG SQL:393 - insert ... |
22. @OneToOne or @ManyToOne on X ref an unknown entity.. SOLVED forum.hibernate.org |
23. @OneToOne and Cascade forum.hibernate.orgHello. I need help with @OneToOne relationship. Now I using bidirectional OneToOne association to handle correct object deletion (CascadeType.REMOVE), but it is impossible Lazy loading on "mappedBy" side. I do not need bidirectional association, I need only correct removal of associated objects. How I can automate removal of associated objects with unidirectional one to many (from not owner side)? Thanks and ... |
24. Hibernate Annotations has problem on @OneToOne forum.hibernate.orgHibernate Annotations has problem on @OneToOne,the failure trace are: java.lang.ExceptionInInitializerError at test.rong.hibernate.HibernateUtil. |
25. @Id + @OneToOne results in incorrect behavior forum.hibernate.org@Entity public class Publication extends DefaultFieldPersistent { @Column(nullable = false) private Date creationDate = Calendar.getInstance().getTime(); @Column(nullable = false) private String name; @Column(nullable ... |
26. Unable to persist data using@onetoOne mapping forum.hibernate.orgI have 2 tables table A with ID and name table B with ID and name i want to insert data in 3rd table which will contain ID from both the tables i.e tableC will have 2 columns : IDtableA IDTableB In The mapping class of table A i am doing something like this @OneToOne @JoinTable(name = "TableA_X_TableB", joinColumns ={@JoinColumn(name = ... |
27. Question about @OnetoOne forum.hibernate.orgpublic static void main(String args[]) { EntityTransaction tx = em.getTransaction(); tx.begin(); Address address1 = new Address(); Student student1 = new Student("Eswar", address1); ... |
28. Hibernate Bi-directional @OneToOne mapping forum.hibernate.orgHi, We have the following entity relation ship. User is the parent entity.DistrictUserDetail is the child. @Entity @Table(name="USERS") public class User implements Serializable { @Id @Column(name="ID", nullable=false) @GeneratedValue(generator="system-uuid") @GenericGenerator(name="system-uuid", strategy = "uuid") private String id; @OneToOne(cascade= {CascadeType.ALL}) @PrimaryKeyJoinColumn(name="ID", referencedColumnName="USER_ID") public DistrictUserDetail districtUserDetail; ... other properties.. This is the parent entity. The child entities primary key is a foreign key to User ... |
29. Column mapped both with @Id and @OneToOne forum.hibernate.org |
30. @OneToOne resutling in org.hibernate.AnnotationException: Un forum.hibernate.orgHi, I have trying a simple onetoone parent child implemetation in hibernate. The relationship is help in the child class with a foreign key to the parent. My 2 tables as as below : Deal (t_deal) -Id -value date -creator -comment DealDetails(t_deal_details) -Id -deal_id //fk to t_deal table -additional_info ============================== @Table(name="t_deal") public class DealBean { : : @Id @GeneratedValue public long ... |
31. @OneToOne lazy fetching forum.hibernate.orgLets say I have the following mapping: @Entity Class Link { @Id Long Id; @OneToOne @JoinColumn(name="portA_id") Port portA @OneToOne @JoinColumn(name="portB_id") Port portB } @Entity Class Port { @Id Long id ..... } When I query for a Link, I dont want it to produce also a select statement for the ports. How should I do it? Thanks, Eyal |
32. @OneToOne + FetchType.LAZY forum.hibernate.orgWith annotation OneToOne, Hibernate is ignoring FetchType.LAZY Code: @Entity @Table(name = "estudante", schema = "ingres", uniqueConstraints = {}) public class Estudante implements java.io.Serializable { private Integer cdEstudante; private EstEnderecoPais estEnderecoPais; // Property accessors @Id @Column(name = "cd_estudante", unique = true, nullable = true, insertable = true, updatable = true) public Integer getCdEstudante() { return this.cdEstudante; } public void ... |
33. Merging a @OneToOne relationship creates orphaned records forum.hibernate.orgI have an Entree object that contains a one-to-one relationship with a Ticket object, and this relationship is annotated with the @OneToOne(cascade = CascadeType.ALL) on the Entree side. I first insert this object into the db with hydration. The tables look like this-- Code: ENTREE entree_id | name | ticket_id ----------------------- 1 | ... |
34. NPE with @Id on @OneToOne forum.hibernate.org@Entity @Table(name = "foo") public class Foo { @Id @GeneratedValue @Column(name = "foo_id") Long id; @OneToOne(mappedBy = "foo", cascade = CascadeType.ALL) FooData fooData; ... @Entity @Table(name = "foo_data") public class FooData { @Id @OneToOne @JoinColumn(name = "foo_id", ... |
35. Primary/Foreign Key @onetoone forum.hibernate.orgHi, I have a problem with a @onetoone annotation, that I've been unable to solve these last couple of days, despite reading almost every post on the subject. Have a class called Vehicle that is link to a table called request, database model would look something like: Vehicle req_no(Primary key for this table, foreign key to request) other suff Request req_no ... |
36. AnnotationException: @OneToOne or @ManyToOne forum.hibernate.orgHello, For some reason suddenly my JBoss started complaining about my mappings. I don't really understand what has happened as this was working for me before. I tried this on JBoss 4.2.1 and 4.2.2. Hibernate version: Hibernate: 3.1.3 Hibernate Annotations: 3.3.0 Hibernate Entity Manager: 3.3.1 Mapping documents: applicationContext.xml: beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/b ... ns-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/t ... tx-2.0.xsd ... |
37. Use of secondary table with @OneToOne forum.hibernate.orgAuthor Message PeteGeraghty Post subject: Use of secondary table with @OneToOne Posted: Tue Feb 26, 2008 6:33 pm Newbie Joined: Tue Feb 26, 2008 9:15 am Posts: 3 Hibernate version: 3.2.6.ga Hibernate annotations version: 3.3.0.ga Database: Oracle 10g Express Edition I have a bidirectional @OneToOne with the foreign key in an entity that is part of an inheritance hierarchy. ... |
38. Mixed Column in a @OneToOne Reference forum.hibernate.org@OneToOne(targetEntity = Association.class) @JoinColumns ({ @JoinColumn(name = "APP_ID", referencedColumnName = "ADMIN_ID", insertable = false, updatable = false), @JoinColumn(name = "CUSTOMER_ID", referencedColumnName ... |
39. @OneToOne cascade (target ID not updated) forum.hibernate.orgHello everyone, I've been trying to work through a problem today and I can't seem to find the solution. I searched the forum, but was unable to find the same issue (which tells me I'm probably doing something wrong). Either way, here's an explanation: I have three Objects. Object1, Object2, Object3 Object1 has a one-to-many relationship w/ Object2 Object2 has a ... |
40. @OneToOne cascade (target ID not updated) forum.hibernate.orgHello everyone, I've been trying to work through a problem today and I can't seem to find the solution. I searched the forum, but was unable to find the same issue (which tells me I'm probably doing something wrong). Either way, here's an explanation: I have three Objects. Object1, Object2, Object3 Object1 has a one-to-many relationship w/ Object2 Object2 has a ... |
41. @OneToOne and @PrimaryKeyJoinColumn mapping usage forum.hibernate.orgHibernate version: 3.2.4.sp1 Hibernate annotation version: 3.3.0.ga Hibernate entity manager version: 3.3.1.ga Database: Oracle 10g Hi, I've been trying to do a one-to-one relationship using the same primary key. It seems that it's way more complex than expected. First, here's my final working result. Deal is aggregating a DealState objet in a one-to-one relationship with a cascade Code: @Entity @Table(name = ... |
42. @OneToOne and @PrimaryKeyJoinColumn mapping usage forum.hibernate.orgHibernate version: 3.2.4.sp1 Hibernate annotation version: 3.3.0.ga Hibernate entity manager version: 3.3.1.ga Database: Oracle 10g Hi, I've been trying to do a one-to-one relationship using the same primary key. It seems that it's way more complex than expected. First, here's my final working result. Deal is aggregating a DealState objet in a one-to-one relationship with a cascade Code: @Entity @Table(name = ... |
43. @OneToOne forum.hibernate.orgHello, I have a question about how to use the one to one annotation and ensure that children are deleted when the parent is updated. Hibernate version: hibernate-core 3.3.1.GA hibernate-annotations 3.4.0.GA hibernate-commons-annotations 3.1.0.GA My test classes: Code: @Entity public class Person { @Id private String id = UUID.randomUUID().toString(); @OneToOne(cascade ... |
44. Problem with @OneToOne annotation forum.hibernate.orgHibernate version: 3.2.6.ga annotations - 3.2.1.ga I'm pretty new to annotations, and I'm trying to get a one-to-one relationship working with no luck. The situation is that I have a class (Company) that extends a MappedSuperClass (PersistentEntity). Company (and some other PersistentEntity subclasses contains an Address. I've searched the web and this is what I've got at this point. From my ... |
45. need @OneToOne mapping help forum.hibernate.orgHi All, I am facing this annoying issue with @OneToOne mapping. Set up is very simple. class User { @OneToMany(cascade = {CascadeType.PERSIST,CascadeType.MERGE,CascadeType.REFRESH},mappedBy = "user",fetch=FetchType.EAGER) private List |