Questions tagged [bidirectional]

"Bidirectional" refers to any process or structure that works in two directions. Use the tag `bidi` for bidirectional text instead of this tag.

"Bidirectional" is a general concept and can have a lot of meanings:

  • bidirectional text, see
  • bidirectional associations of data
  • bidirectional synchronization
  • bidirectional mapping
  • bidirectional communication
  • bidirectional search algorithms

See also: https://en.wikipedia.org/wiki/Bidirectional

493 questions
3
votes
2 answers

Use bidirectional entity methods with Mapstruct

I have bidirectional mapping (@OneToMany Hibernate) with extra methods to ensure that both object linked. Simple example: @Setter class ParentDto { List childList; } @Setter class ChildDto { String text; } @Setter class Parent…
3
votes
2 answers

Implementing a bidirectional association relationship in Python

In Martin Fowler's, UML Distilled, in the "Bidirectional Association" section, he says: Implementing a bidirectional association in a programming language is often a little tricky because you have to be sure that both properties are kept…
Ahmed Alhallag
  • 311
  • 2
  • 11
3
votes
1 answer

Build a server for client/server side bidirectional communication feedback system in Java?

Scenario: User logs in on the client software which forms a persistent bidirectional connection with the serverside entity (server) which would process user specified tasks. When the serverside entity, while processing user's task, encounters an…
KJW
  • 15,035
  • 47
  • 137
  • 243
3
votes
3 answers

Hibernate: AnnotationException: Unknown mappedBy in ... referenced property unknown on reverse (mappedBy), bi-directional @OneToOne associations

I have the following simple design: (source: kawoolutions.com) That's basically a workaround for non-disjoint inheritance which JPA doesn't support. Persons can exist by their own, but there can optionally be a single player entity, a single coach…
Kawu
  • 13,647
  • 34
  • 123
  • 195
3
votes
2 answers

Jackson: How to prevent recursive call by only adding ID field inside child collections

I wanted to simplify my question. I have a parent and a child entity. public class Parent { private String name; @OneToMany private List childs; } and public class Child { private String name; @ManyToOne private Parent…
3
votes
1 answer

BidiMap Synchronization

When using the apache commonds bidimap, how do you handle synchronization. For example, if I create the map as shown below BidiMap oneWay = new DualHashBidiMap(); BidiMap theOtherWay = oneWay.inverseBidiMap(); So if I am going to…
Rob Goodwin
  • 2,676
  • 2
  • 27
  • 47
3
votes
1 answer

Hibernate self-reference mapping puzzle

I am trying to map a class Class Node { Node parent; List children; } I have tried various combinations of many-to-one and one-to-many but nothing seems to work. I would have pasted my mapping file, but I have tried so many things that I have…
javaman
  • 31
  • 2
3
votes
6 answers

Threadsafe bidirectional association in Java

What is a good way to implement thread-safe bidirectional associations? Is there maybe a good library or code generator? Here is a non thread-safe example: class Foo { private Foo other; public Foo getOther() { return other; …
Cephalopod
  • 14,632
  • 7
  • 51
  • 70
3
votes
2 answers

Asynchronous bidirectional messaging between nativemessaging app and webextension?

It seems that the protocol for Nativemessaging entails that the native App communicate with the extension via blocking read-then-write loop. Firstly, is that correct? If so, that makes it pretty hard to establish bidirectional asynchronous…
3
votes
1 answer

Implement BidirectionalGridLSTM

I’m implementing a chatbot using Tensorflow’s seq2seq model[1], feeding it with data from the Ubuntu Dialogue Corpus. I want to compare an RNN using standard LSTM cells with Grid LSTM cells described in Kalchbrenner et al [2]. I’m trying to…
siljech
  • 106
  • 6
3
votes
2 answers

Hibernate @OneToOne with Shared Primary Key(bidirectional). Dependent entity not persisted in DB.

I have two entities PointOfInterest (referred as POI from here on) and its Address. I want to define a one to one bidirectional mapping with shared primary key between the two, with POI as owner entity. I am using postgreSQL DB, POI table has POIId…
nbnb
  • 87
  • 2
  • 12
3
votes
5 answers

Two Classes Dependent On Each Other

I have Camera class, which handles camera behavior. Among it's fields is a reference to the target's Cube class (Cube is just one of the object, but I won't mention others to keep it simple). In order to calculate the View matrix, I need the…
avance70
  • 787
  • 1
  • 11
  • 22
3
votes
1 answer

HTML RTL / LTR switch

I have a Web application that needs to support all languages, including Middle-East. After some reading, it would appear that using the dir tag does the job in many cases (for instance, text aligns correctly and I have a tables that correctly swap…
FDavidov
  • 3,505
  • 6
  • 23
  • 59
3
votes
2 answers

Bidirectional one-to-many with one as owning side

Is there no way of making the 'one' the owner side of a one-to-many relationship? Every single sample has mappedBy in @OneToMany. Even the answer to this similar question has that. I want the one side to be the owning side because when I add a…
user384729
  • 403
  • 1
  • 7
  • 16
3
votes
0 answers

there exist a Universal Cache Middleware (bi-directional cache) between Database and Application?

Is there a universal cache middleware between database and application that can automatically cache objects/entities when they are inserted/updated to database or queried from database, and return them to application instead of querying from…
Viky Leaf
  • 195
  • 3
  • 16