Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
24 views

Hibernate: Update OneToOne id

Use case: All programmers are persons, but all persons are not programmers. Persons are created first, and at a later stage the decision gets made to add the programmer attributes. The relationship ...
Johan's user avatar
  • 351
0 votes
0 answers
12 views

A bidirectional one-to-one association on a foreign key is common with many-to-one issue

[tag:`XML Approach <class name="Campaign"> <id name="id" column="cmp_num"> </id> <one-to-one name="person" property-ref="...
Faseeh Ahmad's user avatar
0 votes
1 answer
14 views

JPA, removing parent cannot remove all children

I have a @OneToOne relation between Parent and Child tables , I need to delete all child if happen delete on parent because children doesn't have meaning without parent ! Parent Entity : @Entity(name =...
KronosOne's user avatar
  • 157
1 vote
1 answer
50 views

Usage of OneToOneField in Django

I am very confused about the usage of the OnetoOneField. I thought it was for a case where a given record can only have 1 reference to another table. For example, a Child has 1 Parent. But it seems ...
Peter Kronenberg's user avatar
1 vote
0 answers
27 views

@OneToOne unidirectional relation problem

I have two java classes: @Data @NoArgsConstructor @AllArgsConstructor @SuperBuilder @EqualsAndHashCode(callSuper = false) @FieldDefaults(level = AccessLevel.PRIVATE) @Entity @Table(name = "parent&...
Kalin Damyanov's user avatar
0 votes
1 answer
44 views

Create one-to-one relation without adding reference in one of the tables

I have 2 tables Company (Id uniqueidentifier, ...) and Address (Id int, ...) and representative entities Company and Address. They should have a one-to-one relationship. As I don't want to have any ...
demo's user avatar
  • 6,197
0 votes
0 answers
48 views

Trouble Determining Dependent Side in One-to-One Relationship with Entity Framework Core

I'm currently working on a project using Entity Framework Core in a .NET Core application. I'm having trouble determining the dependent side in a one-to-one relationship between the User and Account ...
changedevelopersoftware's user avatar
0 votes
0 answers
20 views

Can't pass instance while creating an DB entry in django

I have two models, DocumentData & RecurringInvoice, which have a one to one relationship with each other. When I create an entry in the RecurringInvoice table, I want to pass in the DocumentData ...
U. Watt's user avatar
  • 631
0 votes
0 answers
29 views

React Hook Form in Relationships

I am using the react hook form to get the form data. I got it with login data, but now I need to get the data for a signup form. The problem is the API asks some relationships like below: "...
Felipe Almeida's user avatar
0 votes
0 answers
39 views

Springdata jpa save OneToOne related entity with Parent's single save gives null id despite setting both directions

Using spring data jpa 2.7.5 Here are my entity relations - @Entity pubic class ParentEntity{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "parent_id&...
user2176576's user avatar
0 votes
0 answers
36 views

How can I restrict the number of matches in reclin2?

I am working on an record linkage issue and use the package reclin2. Within each block I compare all records with each other and want to link the records using one of the functions select_greedy or ...
Marius's user avatar
  • 3
0 votes
1 answer
107 views

ASP.NET Core exception : cannot create a DbSet for 'IdentityUser' after creating a 1-to-1 relationship with identityuser

I'm just converting now over to ASP.NET Core from using ASP.NET MVC a lot. I have a VS 2022 project targeting .NET 8.0. I wanted to create a 1-to-1 table relationship with the IdentityUser to store ...
ChrisOBrien's user avatar
0 votes
1 answer
35 views

orphanRemoval does not work in OneToOne relationship

I have this two class in Java @Entity @Table(name = "user") public class UserDb { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @OneToOne(mappedBy ...
ZottoSL's user avatar
  • 168
0 votes
1 answer
34 views

Hibernate CascadeType Issue: Updates not Cascading to Child Entity

I'm encountering an issue with Hibernate when trying to update a parent entity that has a one-to-one relationship with a child entity. Specifically, I've configured CascadeType.ALL for the ...
Coder 's user avatar
1 vote
1 answer
100 views

OneToOne mapping leading to performance impact due to N+1 select issue

Below are my entities and I am currently facing hibernate n+1 issue with D entity. I am trying the get the details from table A whose response contains more than 500 entries. After that it is querying ...
user23593450's user avatar
2 votes
1 answer
135 views

TypeORM: How to get joined columns into entity as value?

I try to join data of different tables tbl_book_locations, tbl_book_sizes into one entity book (the other tables are just for later discussions). I cannot change the database structure (sadly). So ...
rokdd's user avatar
  • 642
0 votes
1 answer
38 views

Repeat the foreign keys or use two tables related as a one-to-one

I have two tables sessions and schedules, and I want to add a new table destinations. The destinations table can be related to both tables, but only ONE destination can be related to a session or ...
Juan Manuel's user avatar
0 votes
0 answers
31 views

hibernate one to one using xml mapping with null foreign key

I am new to Hibernate learning entity mapping using hibernate framework via instead of annotation i am using XML for mapping the entities using foreign key. Here is my database : employee.java : ...
Zoya's user avatar
  • 1,205
0 votes
0 answers
37 views

C# EF - How to setup a one-to-many styled many-to-many junction table as one-to-many?

Sorry if the title is confusing or incorrect. First time I've seen a junction table setup like this before and that's the best way I can think to describe it. I have the following table classes setup ...
Tyler Mason's user avatar
0 votes
2 answers
121 views

JSON Serialization Issue with Bidirectional OneToOne Relationship

I have two Java entities with a bi-directional One To One relationship between them: Sinistre and RapportTechnique. When I generate the JSON file to send to the front end, I encounter unwanted ...
Zade Abderrahmane's user avatar
0 votes
1 answer
36 views

OneToOne relationship - where should be Id

There is many question about oneToOne or OneToMany but I can not get answer why my app does not save id. I have two entities: @Entity Person { private String id; private String Name; ... } ...
Lulex97's user avatar
-1 votes
1 answer
81 views

Cannot using one-to-one relation in java spring

i have a question in javaspring, when using one-to-one relation, why i cannot mapping the username in khachHang class with the login class, althought the login.getUsername is not null, i have tried ...
Nguyen Dang's user avatar
0 votes
0 answers
35 views

How to manage concretely with unamangeable model relationship in Power BI

I was asked to use two sources of data sharing the same column and build both a many-to-one and one-to-one relationship with PowerBI. It is not possible to modelize any of two relationship and ...
12666727b9's user avatar
  • 1,097
0 votes
1 answer
21 views

How can set which data in this Entity will be save to the DB (Mysql)

@Entity @Table(name = "verification_token") public class VerificationTokenEntity { private static final int EXPIRATION = 60 * 24; @Id @GeneratedValue(strategy = GenerationType....
Reddot810's user avatar
0 votes
2 answers
48 views

OneToOne delete data

how can I delete data in one table and not affect data from 2 tables? for example, I want to delete resume_id 5 -> user_id 12. If I delete resume_id 5, then user_id 12 is also deleted. how to fix ...
AssylkhanAz's user avatar
0 votes
3 answers
208 views

In NestJS 10 with TypeORM, how do I update a field in my entity's @OneToOne member?

I'm using NestJS 10 with TypeORM 0.3.17. I have defined this entity wiht a @OneToOne relationship @Entity() export class User { @PrimaryGeneratedColumn('uuid') id: string; ... @Column() ...
Dave's user avatar
  • 18k
0 votes
0 answers
33 views

EF Core Query One To One Self Relation

In EF Core I want to manage a collection of Parameters (Entity Parameter). A Parameter is basically a named Value and can belong to a Recipe or can be global (no Recipe). Therefore the Reference from ...
AndiR's user avatar
  • 191
0 votes
0 answers
80 views

Error in Foreign Key and one to one field relationship between two Apps In Django Project

In my Django project i have two apps first app(product) and second app(store), product app has a custom user model while store app don't have custom user models. when i try to use a foreign key or one ...
Kingsley Wlyson's user avatar
1 vote
1 answer
41 views

Entity Framework Core not saving all one-to-one relationships on an entity

I have a BankReport entity class with 71 optional, one-to-one relationships. All of the 71 related entities are similar. They all have a PK / FK which is the ID of the parent BankReport. If I create a ...
Eric F's user avatar
  • 21
0 votes
1 answer
114 views

java.sql.SQLIntegrityConstraintViolationException: ORA-02291: integrity constraint violated - parent key not found

Table relationship> I am trying to insert the data in 3 different tables - JV_SNAPSHOT, JV_GLOBAL_ID, JV_COMMIT. It's corresponding Bean class are given below: @Entity @Table(name = "...
Rahulv's user avatar
  • 1
0 votes
1 answer
399 views

Spring 5 Data Jpa - OneToOne on a specific literal property

After Spring 5 Data Jpa - OneToOne, new entity, a single insert operation is solved, I have the following tables: UserDetails, with userId UserPreference, with userId, propertyType, values, and ...
Matan Shukry's user avatar
1 vote
1 answer
2k views

Spring 5 Data Jpa - OneToOne, new entity, a single insert operation

I have table User entity/table with id as primary key / string / uuid generated value. I also have UserDetails entity/table with userId as primary key / string / foreign key to user.id. Note that in ...
Matan Shukry's user avatar
1 vote
1 answer
887 views

mapping jooq record entity to pojo with nested objects

i have two tables d_cities, d_countries. Mapping between them is unidirectional like this: also, i have two pojo dtos like this: Entity classes are jooq generated. Now I can't come up with the ...
Gaziz Bakyt's user avatar
-2 votes
1 answer
100 views

How to create and insert into a table in SQL entity that has two mutually exclusive 1:1 relations?

How do I handle the code for creating these tables and inserting into them? Tried this but failed : create table vlasnik ( vlasnik_id integer not null constraint vlasnik_pk primary key, ...
Matea_my's user avatar
0 votes
1 answer
65 views

Query and get one-to-one related tables from schema metadata that exists within a schema

How to query and find out one-to-one related tables in a schema from database metadata information. onetoone relationship established by primary and foreign key or by unique constraints whatever ...
Nithya M's user avatar
2 votes
0 answers
405 views

Hibernate 6, OneToOne association, Criteria request and Order condition

I'm facing a problem with a criteria request while migrating a "spring boot 2.7 / hibernate 5" app to "Spring boot 3.1.1 / Hibernate 6.2.5". The database is h2 2.1.214. Here are ...
BrunoLochet's user avatar
1 vote
0 answers
50 views

I have created a one-to-one relationship in SQLAlchemy, but I get this error message

I have created a one-to-one relationship in SQLAlchemy, but when I try to retrieve all passengers and their information using a get request, I get this error message: "(TypeError TypeError: '...
Mahdirsh's user avatar
0 votes
2 answers
124 views

hibernate| find by id for @OneToOne returns entity in recursion

I Have two entity class Movie and movie cast with one to one relationship when I save them it is saved properly in DB(Postgres) but when I do find by Id I get recursive/cascading result meaning: Movie ...
satyesht's user avatar
  • 593
0 votes
0 answers
100 views

Envers - NonUniqueResultException when auditing a one-to-one association

I have a one-to-one association between class A and class B mapped as following : ` public class A implements Serializable { private B b; @OneToOne(mappedBy = "A"...
dev1's user avatar
  • 73
2 votes
1 answer
539 views

How do I configure a nullable 1-1 relationship in EF Core?

I am dealing with payment devices. The device owners have to obtain terminal IDs (TIDs), which are obtained in bulk, and then associated with a specific device. Therefore, a device may or may not have ...
DreamingOfSleep's user avatar
0 votes
1 answer
29 views

Extra column created in db while using Hibernate OnetoOne Bidirectional

I am practicing Hibernate and I am getting the data populated in the db but there is an extra column that is being added along with the JoinColumn Entities: Mobile Class- @Entity public class Mobile { ...
rookiedev's user avatar
0 votes
0 answers
83 views

Accessing OneToOneRel object in Django to perform search

I am working on a Django project, where we have created many relations between objects. In general - everything is working fine, expect - Frazesearch. Below are my model classes: Students.py from ...
Fishy_Code's user avatar
0 votes
1 answer
660 views

Why am i getting a jackson No serializer found error for JPA entity on OneToOne mapping?

I created two JPA entity classes to represent the following tables: I think that the one-to-one relationship I setup is incorrrect because I am getting the error: com.fasterxml.jackson.databind.exc....
Rob Gravelle's user avatar
-2 votes
2 answers
420 views

Laravel One To One Relationship With Custom Foreign Key NOT WORKING

I'm working with Laravel v10 and I have a users table and each user has also another record at the members table. So in order to set up the One To One Relationship between these two Models: User Model:...
Peter Amo's user avatar
  • 193
1 vote
0 answers
631 views

How to Delete child without deleting parent in one-to-one bidirectional mapping?

I have one-to-one mapping on both parent & child side, I want to delete only child without deleting the parent, parent_id is set to not null so that we don't end up with null values. When I try to ...
Ashmita Kanojia's user avatar
0 votes
1 answer
59 views

How to create a one-to-one relationship between two entities on a PK using JPA?

I'm trying to link two entities using JPA via a one-to-one relationship, but I'm getting a "referenced property unknown" error one one of the classes. Here is a diagram of the two entities ...
Rob Gravelle's user avatar
0 votes
1 answer
183 views

Why am I getting a JPA @OneToOne Unknown Entity Error?

I am getting the error "org.hibernate.AnnotationException: @OneToOne or @ManyToOne on ca.allauto.ups.model.Vehicle.modelId references an unknown entity: java.lang.Long" for the following ...
Rob Gravelle's user avatar
0 votes
1 answer
49 views

LARAVEL 7 One to One Relationship Dropdown list only display items with no relationship

I'm using Laravel 7 and creating a dropdown list where the book should only display items that do not relate to the student because I'm creating a one on one relationship. How am I going to do that? ...
kimski's user avatar
  • 45
0 votes
1 answer
36 views

How to use Jackson library annotations to avoid infinite recursion and still get some properties at the same time?

I have two simple classes : Student and Certificate, related by a bidirectionnal @OneToOne relationship. My goal is to retrieve the certificate from the student, which works fine using @OneToOne and @...
idash's user avatar
  • 29
0 votes
1 answer
31 views

Persist one to one undirectional mapping from parent

I need to persist the child automatically when I try to persist parent in one to one undirectional mapping. Imagine I have employee parent table, and employee detail as child table both have one to ...
bharathi's user avatar
  • 6,181

1
2 3 4 5
31