Questions tagged [bidirectional-relation]
98 questions
1
vote
1 answer
Failing to insert the foreign key in the owning table when save method is being fired from the non-owning object in a bidirectional relationship?
So I have Two entities 'Student' and 'Parents' and the relationship between them is of 'OneToOne'.
Owning side here is 'student'.
Student.java
import java.util.UUID;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import…

Sumit Kumar Singh
- 11
- 2
1
vote
1 answer
Spring Data JDBC one-to-many relation causes lots of log warnings
Summary: Spring Data emits warnings as it SELECTs the the same column twice. The warning is:
(...) WARN o.s.d.j.core.convert.ResultSetAccessor : ResultSet contains id multiple times
This is spring-boot-starter-data-jdbc via Spring Boot 2.5.5…

zb226
- 9,586
- 6
- 49
- 79
1
vote
1 answer
nhibernate - nhprof -unbounded result set on lazy load for a one to many bi-directional association
I have a standard Category domain entity which has corresponding children. i.e category and its corresponding sub categories. This is shown below. Pretty standard stuff really.
public class Category : Entity
{
private…

dezzy
- 479
- 6
- 18
1
vote
1 answer
One to Many Relation mapping using org.mapstruct framework
How can I map the one to many relationship using org.mapstruct framework?
DTO classes:
@Data
public class ScheduledJobDTO {
private String jobName;
private String jobGroup;
private String jobClass;
private String cronExpression;
…

Atul
- 133
- 3
- 12
1
vote
1 answer
JPA @ManyToOne, @OneToMany bidirectional relation
I'm studying bidirectional mapping.
I mapped Team and Member with @OneToOne and @ManyToMany annotations.
@Entity
public class Team {
@Id @GeneratedValue
private Long id;
private String name;
@OneToMany(mappedBy = "team")
…

Hyunj
- 49
- 1
- 1
- 4
1
vote
0 answers
TypeORM bidirectional composite primary key relations
One User can have multiple Profiles. In the User I only want to store the profileId. In the Profile I want to store the id of the User.
User
@Entity()
export class User {
@PrimaryGeneratedColumn()
id: string;
@Column({ nullable: true })
…

dewey
- 809
- 2
- 16
- 47
1
vote
1 answer
Two problems in a @OneToOne relationship
I am using Hibernate 4.3.6.Final, and WildFly 16. I have two problems with a @OneToOne relationship.
1.) First problem: Unknown mappedBy in: at.home.digest.model.Expose.home, referenced property unknown: at.home.digest.model.Home.expose"}}
These are…

Alex Mi
- 1,409
- 2
- 21
- 35
1
vote
1 answer
Why don't most graph databases support bidirectional edges?
I have to choose a graph database system and am very surprised that the mainstream ones don't support this feature ?
Why is it such a no-go for database systems ? And why developers out there don't seem to ask for it ? There should be a reason I'm…

snwfdhmp
- 360
- 2
- 11
1
vote
0 answers
Saving the inverse side of a many-to-many relation
I try to make it possible to save a relation on the inversed side of the relation. I know that this isn't possible in Doctrine but I found various articles which show a possibility. The problem is that the described way doesn't work for me.
My…

mgluesenkamp
- 529
- 6
- 19
1
vote
1 answer
Creating multiple bi-directial one-to-many associations with Fluent NHibernate automapping
I am fairly new to NHibernate and the .NET framework.
I want to map my Project class, which has one-to-many relations Subproject and ProjectTask classes.
public class Project : ProjectItem
{
public virtual IList Subprojects { get;…

abedurftig
- 1,118
- 1
- 12
- 24
1
vote
1 answer
Searching nth-level friends in neo4j.rb in bi-directional relationship graph
I have a User class defined as below
class User
include Neo4j::ActiveNode
include Neo4j::Timestamps
property :user_id, type: Integer, constraint: :unique
property :max_friends_count, type: Integer, default: 5
validates :user_id, :presence…

user2172335
- 101
- 1
- 10
1
vote
1 answer
Losing the child data in a bi-directional relationship when using jacksonMapper
I have two classes as shown below in a bi-directional Many to Many relationship:
Parent implements Serializable{
@ManytoMany(//declaration for join table)
@JsonBackReference
@com.fasterxml.jackson.annotation.JsonIgnore
…

raikumardipak
- 1,461
- 2
- 29
- 49
1
vote
1 answer
Bidirectional belongsToMany association on same model
This EntitiesTable has a belongsToMany association with itself:
class EntitiesTable extends AppTable
{
public function initialize(array $config) {
parent::initialize($config);
$this->belongsTo('Users');
…

Lars Ebert
- 3,487
- 2
- 24
- 46
1
vote
1 answer
Bidirectional relationships in JPA
I am missing something very fundamental. Given below two entities Department (inverse side) and Employee (owning side) forming a one-to-many relationship from Department to Employee.
Department.java
@Entity
@Table(catalog = "testdb", schema = "",…

Tiny
- 27,221
- 105
- 339
- 599
1
vote
1 answer
Including all @OneToMany Entities in Restful-WebService response?
First Post here,so please excuse any noobish approaches to best get your attention / help me you find an answer. :)
Without going into too much detail of my actual Program:
I have a User who can register many Devices which can be associated to many…

Cristopher Hornsey
- 55
- 6