Q: Marshmallow features

Issue #80 closed
Jan Drozen created an issue

Hello, I want to use Marshmallow for some scenarios and I'm not sure if it is nowadays supported.

  • transitive many-to-one loading: assume I have three mapped entities: A (n-1) B (n-1) C to classes TA, TB and TC. TA contains field fB of type TB annotated with attribute ManyToOne. The TB has similar attribute as well. There are some other attributes like foreign keys and so on. Now, when I call:
session.FindAll<TA>;

Can I get TA.fB.fC correctly loaded? At this time, I get a runtime error: EListError - Item not found (raised at TEntityWrapper.GetPrimaryKeyValueFrom) since TC mapped columns are not included in generated query.

  • many-to-many relations: is it possible to map this pattern without mapping the weak (associative) entity as class? Assume I have entities A and B: A (m-n) B. The database structure is normalized to A (1-n) W (n-1) B. In OO code I want to treat the relation as (1-n) for A as well as for B. Can I achieve this without creating and mapping a class for the helper-table W?

Thank you for responding!

Comments (2)

  1. Linas Naginionis

    Hi,

    • Currently, it should only possible to load TA.fB as ManyToOne relationship, but you can always load all of your entities separately.
    • Many-To-Many relations are not supported out of the box but they can be emulated by combining OneToMany and ManyToOne realations. I've added example to TSession unit tests how this could be achieved.
  2. Log in to comment