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
-1
votes
2 answers

Spring mvc hibernate, primary key not changing value of foreign key

I have a relationship one-to one: User: @Entity public class User { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "id") private int id; private String firstName; @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name = "id",…
-1
votes
1 answer

Getting error on one to one function on laravel

I want to join tbl_company_list and tbl_commpany_detail using one to one function on Laravel. @ompany_list table id (primary_key) | symbol | companyname | sectorid | status @company_detail table id (primary_key) | companyid | shares | paidup |…
sudeepsth
  • 42
  • 2
  • 14
-1
votes
1 answer

How can I differentiate between users with lookup

I have two classes Customer and Restaurant that have OneToOneField with the django built in User. When I go to a page I am trying to determine which User it is. What I am doing doesnt work because the User model will always return True for having a…
ratrace123
  • 976
  • 4
  • 12
  • 24
-1
votes
3 answers

Two "One to One" relationships between two classes

I have entity Customer and entity Ticket. Customer can have two different tickets. List of Tickets and OneToMany relationship is not suitable there, because I should have two different fields in Customer entity for tickets: ownTicket and…
Yuriy
  • 1,370
  • 4
  • 14
  • 30
-1
votes
1 answer

Symfony forms - setting an empty value for an entity with OneToOne bidirectional relationship

I have a User entity with bidirectional relationship to Passport entity /** @Entity */ class User { /** * @OneToOne(targetEntity="Passport", mappedBy="user") * @JoinColumn(name="passport_id", referencedColumnName="id") */ …
-1
votes
1 answer

NSFetchedResultsController with NSSortDescriptor one to one

Want to sort by name which have one to one relationship using NSSortDescriptor in NSFetchedResultsController. Here my code NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:[studentDetail…
-1
votes
1 answer

How to collapse one-to-one parent-child tables into classes with Fluent NHibernate?

How do I map these existing tables to the classes below? I have the following tables: CREATE TABLE dbo.UserContact ( UserContactId int NOT NULL IDENTITY (1, 1), UserId int NOT NULL, ContactId int NOT NULL, UserContactTypeId int NOT NULL, …
alphadogg
  • 12,762
  • 9
  • 54
  • 88
-1
votes
1 answer

Spring Data JPA: OneToOne with shared primary key doesn't seem to work

Using Spring Data JPA from Spring version 4.0.7, backed by Hibernate (judging by import of Envers 4.3.6), I wanted to create a one-to-one relation between two entities - Payment and PaymentFailure. When a Payment fails, PaymentFailure is created…
Vlasec
  • 5,500
  • 3
  • 27
  • 30
-1
votes
1 answer

Error creating One-to-One relationships in Entity Framework 6 Code First

I am following this tutorial to make a one-to-one relationship but with no avail. http://www.entityframeworktutorial.net/code-first/configure-one-to-one-relationship-in-code-first.aspx here is my quick mock up public class Information { public…
Mark Hollas
  • 1,107
  • 1
  • 16
  • 44
-1
votes
1 answer

One to One relationship with both tables having multiple entries (Access SQL)

I'm having trouble trying to implement this database; I have three tables Courses, Schedules, and Students. Students have studentID, name, GPA, etc. Schedules have ID, course1, course2, course3 Courses have courseID, courseName, courseAbbv,…
Rafi
  • 1
  • 3
-1
votes
2 answers

C# Unique one-to-one mapping dictionary

I am writing a small piece of code to serialize classes to binary that can be deserialized into an object without knowing the type on the receiving side. The type is defined in the assembly, but you don't have to provide it in the method call (e.g.…
Philippe Paré
  • 4,279
  • 5
  • 36
  • 56
-1
votes
1 answer

How to get value from onetoone relation using request user

im setting the request user in templates using this code, and this code work really good. {% if user.is_authenticated %} {{ user.name }} {% else %} xxxxxxx {% endif %} tables: user(model.Models): id ... Profile(model.Models): …
Jmint
  • 60
  • 1
  • 10
-1
votes
2 answers

Doctrine 1.2: How do i prevent a contraint from being assigned to both sides of a One-to-many relation?

Is there a way to prevent Doctrine from assigning a contraint on both sides of a one-to-one relationship? Ive tried moving the definition from one side to the other and using owning side but it still places a constraint on both tables. when I only…
prodigitalson
  • 60,050
  • 10
  • 100
  • 114
-1
votes
3 answers

Map table inheritance as a one-to-one relationship with NHibernate

I have a database that has a one-to-one relationship modeled between a Person and a Address (that uses person id). However, I cannot find a way to make the map using NHibernate. My table structure is the…
tucaz
  • 6,524
  • 6
  • 37
  • 60
-1
votes
2 answers

com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column cannot be null / one-to-one mapping

I checked so many different posts but couldn't figure out the problem. Please help me to solve it. My approach may be wrong, I am not sure. @Entity(name="user_password") @Table(name="user_password") public class UserPassword { @Id …
likeachamp
  • 765
  • 4
  • 11
  • 21
1 2 3
99
100