Skip to content

Error when having a many to many relationships table between the same entity #131

@ThibBal

Description

@ThibBal

My model:

  • I have a geo_locations table which is composed by locations (cities, regions, countries, departments)
  • I have a table named geo_locations_relations, a many to many relationships table that is used to describe the relation between a location and one of its parents :
    ex: Paris 8e Arrondissement -> Paris
    ex2: Paris -> Ile de France
    ex3 : Paris 8e Arrondissement -> Ile de France

Structure of the geo_locations_relations table:

  • id PK
  • parent_location_id FK geo_locations
  • location_id FK geo_locations

Behaviour:

  • TDBM5 doesn't create the DAO of the table (that's normal) but generate a function in the AbstractGeoLocation Bean named getGeoLocationsByGeoLocationsRelations
  • But this function doesn't work. When executed, an error occurred:
    "There are many possible shortest paths between table 'geo_locations' and table 'geo_locations_relations'
    Path 1: geo_locations <--(location_id)-- geo_locations_relations
    Path 2: geo_locations <--(parent_location_id)-- geo_locations_relations"

What I would like: I don't know 🙃 Maybe two functions which specify the column to use for the path (the starting point):

  • getGeoLocationsByGeoLocationsRelationsUsingLocationId
  • getGeoLocationsByGeoLocationsRelationsUsingParentLocationId

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions