문제

ellou'

I have two models Entry and Entrant which has ManyToMany relationship with annotations. While generating the DDL Ebean adds entry_entrant table which contains fields for mentioned models' IDs.

In general I need to extend this table, to add fields for ie date of creation of relationship or user who added the relation.

Is that simplified way to do this with annotations, or should I just create two OneToMany relationships and add manualy model of EntryEntrant association?

Thanks in advance, biesior!

도움이 되었습니까?

해결책

I had similar problem with hibernate. I used the second aproach and created a normal class with fields I needed. Than from the 2 other classes (in your case Entry and Entrant) I created @OneToMany relationship to the third class. To be hones it`s a good way case many to many is create by two one-to-one with agregation table. Here you just creating this manualy

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top