← Back

Post Thread

I like where #Apache Ossie is heading, an open standard for semantic models is way overdue. One thing I'd like to see added is the ability to define many-to-many relationship in an easier way.

Currently in #Apache Ossie a relationship has no cardinality field — from is always the many side and to is always the one side, so direction is the cardinality. Every relationship is therefore effectively many_to_one from from → to

To define a many-to-many relationship a bridge semantic has to be used Ossie.

Many-to-many relationship between Orders and Coupons


relationships:
  # Bridge (many) -> Orders (one)
  - name: redemptions_to_orders
    from: coupon_redemptions
    to: orders
    from_columns: [order_id]
    to_columns: [order_id]

  # Bridge (many) -> Coupons (one)
  - name: redemptions_to_coupons
    from: coupon_redemptions
    to: coupons
    from_columns: [coupon_id]
    to_columns: [coupon_id]
    
    

Many-to-many relationship between University Courses and Students (Enrollments)


relationships:
    - name: enrollments_student
    from: enrollments   # many side
    to: students        # one side
    from_columns: [student_id]
    to_columns: [student_id]

    - name: enrollments_course
    from: enrollments   # many side
    to: courses         # one side
    from_columns: [course_id]
    to_columns: [course_id]
    
0 Replies
0 Reposts