Questions tagged [one-to-one]

Refers to the quantity of an entity as a relationship to another entity. Meaning that for every instance of an entity, there is a single related instance of another entity.

Refers to the quantity of an entity as a relationship to another entity.

Meaning that for every instance of an entity, there is a single related instance of another entity.

1496 questions
0
votes
1 answer

Django Tastypie POST request for OneToOne relation

I have recently started django-tastypie and so far loving the framework. With said that, I am getting below issue on POST for OneToOne relation to model and spent good amount of time but couldn't figured whats missing. Here is the Model and Resource…
Mutant
  • 3,663
  • 4
  • 33
  • 53
0
votes
0 answers

hibernate bidirectional one-to-one mapping

I am trying to figure out how to define an one to one relation given the below prerequisites /note there is no reference to Activity in the Schedule class/. I can't get both keys to be inserted. I looked here one-to-one but still can't get it to…
John Stadt
  • 500
  • 7
  • 17
0
votes
1 answer

Creating OneToOneField with base model

Sometimes in course of time model becomes too huge. There is a desire to split it on a several models and connect them with OneToOneField. Fields that uses most often, kept in primary model, other fields moves into other models. However this…
Vladimir Lagunov
  • 1,895
  • 15
  • 15
0
votes
2 answers

JPA Inheritance strategy JOINED - OneToOne relation in child class - why it doesn't work?

I have 3 tables represented by JPA model. First one: @Entity @Table(name = "DECISION") @Inheritance(strategy = InheritanceType.JOINED) public abstract class Decision { @Id private Long id; } Next class extends Decision: @Entity @Table(name…
null
  • 165
  • 1
  • 11
0
votes
1 answer

database design for 1 activity has 1..* date_held

i would like to learn from you on designing the database schema: ie. my problem is 1 activity has 1..* date_held eg. activity name is "see movie" has date_held on 1 Sep "shopping" has date_held on 2 Sep , 5 Sep, 6 Sep Method1 so my current database…
Samuel Lui
  • 159
  • 1
  • 1
  • 11
0
votes
1 answer

.NET CTP5 Code First EF. LazyLoading set to False still doesn't cause explicit loading of one to one

I have the following (vb.net) model classes: Public Class Contact Implements IModelEntity Public Property ID() As Integer Public Property Name() As String Public Overridable Property ContactDetails() As ContactDetails Public…
0
votes
1 answer

About one to one relationship in Models in rails

I have three models class Vehicle < ActiveRecord::Base has_one:driver ,:through=>:vehicle_driver end class Vehicle_Driver < ActiveRecord::Base belongs_to:vehicle belongs_to:driver end have only vehicle_id and driver_id class Driver <…
Mohammad Sadiq Shaikh
  • 3,160
  • 9
  • 35
  • 54
0
votes
1 answer

Core-Data One-to-One Relationship, Save Not Working

I’m missing the boat on something that I thought I had the hang of and was hoping someone here could help. I’m using Xcode version 4.4 and my project is using Core Data, Storyboards and ARC. My project has the following 3 entities. All works well…
JimVision
  • 454
  • 4
  • 15
0
votes
1 answer

From child or from parent navigation properties in Entity Framework Code First

Given I have two entities: Deputy and DeputyProfile: public class Deputy : IdableEntity { [Required] public string FirstName { get; set; } public string Patronimic { get; set; } [Required] public string LastName { get; set;…
Maxim V. Pavlov
  • 10,303
  • 17
  • 74
  • 174
0
votes
1 answer

belongs_to won't associate records even with the correct Id stored

When a User is created a Team is created and the User is set as the owner of that team and also set as a member of that team. A User can be a member of many Teams and Teams can have many members. Each User can own only one team and a Team can have…
0
votes
1 answer

OnetoOne Hibernate Mapping

In a One To One mapping, I wrote the following lines of code. @GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name="property", value= "post")) @Id @GeneratedValue(generator = "generator") public int…
Akhil K Nambiar
  • 3,835
  • 13
  • 47
  • 85
0
votes
1 answer

bidirectional OneToOne Mapping : From Entity to subclass and from superclass to Entity?

I'm trying to establish a tricky bidirectional OneToOne mapping in hibernate. I got the following classes : @Entity @Inheritance(strategy = InheritanceType.JOINED) public class Parent { @OneToOne private AnotherEntity…
Teocali
  • 2,725
  • 2
  • 23
  • 39
0
votes
1 answer

nHibernate map a property from many-to-many with filter (It Is like One-To-One)?

I've a Many-To-Many relation but I need to restrict it to only one row that have a specific data in a column. This is the relation: I need to Map in the "Product_Type" entity the "Label" field as if it were in the entity. How can I filter the…
0
votes
1 answer

how to make one to many mapping in hibernate struts2

i am having a tables login [login_id, login name] user[username, login_id, domain_id] doamin[domain_id,domain_name] i will pass a login name. and i need to get the domain name the sql query for that is SELECT m_domain.email FROM ( …
Ashok.N
  • 11
  • 1
  • 3
0
votes
2 answers

Hibernate produces extra sql

I have two entities: Parent and Child. And there is @OneToOne relationship between them. I have the following query: from Parent p left join fetch p.child. If there is a row in Parent with non existing child key(-1 for example) hibernate issuing…
netslow
  • 3
  • 3