Additional properties on JoinTable
See original GitHub issueIssue type:
[*] question [ ] bug report [ ] feature request [ ] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[ ] mssql
[*] mysql
/ mariadb
[ ] oracle
[ ] postgres
[ ] sqlite
[ ] sqljs
[ ] react-native
TypeORM version:
[*] latest
[ ] @next
[ ] 0.x.x
(or put your version here)
Steps to reproduce or a small repository showing the problem:
Would it be possible to add additional columns on JoinTable to keep relation specific data.
export class ProductGroup {
@PrimaryGeneratedColumn()
id: number;
@ManyToMany(() => ProductGroup)
@JoinTable({
name: "accessory",
joinColumn: {
name: "product",
referencedColumnName: "id"
},
inverseJoinColumn: {
name: "accessory",
referencedColumnName: "id"
},
})
accessories: ProductGroup[];
}
Here each product has many related products, and they need to be sorted according to specified order, for which I need to save additional field order
on the accessory
table.
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Adding additional Property to hibernate JoinTable
I am joining the two entities using @JoinTable, however, I would like to add a "status" column to the join table to tell...
Read more >Persist extra attributes for relationships with JPA & Hibernate
Even join tables for many-to-many relationships are hidden behind a @JoinTable annotation, and you don't need to model the additional table as an...
Read more >Join table extra properties | Objection.js - GitHub Pages
In objection, these properties can be defined as extra properties of many-to-many relationship. Let's consider a schema like this: exports.up = knex =>...
Read more >Code First Entity Framework: Additional properties on many to ...
One of the features of Code First is the automatic creation of join tables for many to many relationships, Entity Framework will manage ......
Read more >JoinTable (Java(TM) EE 7 Specification APIs)
Annotation Type JoinTable ... Specifies the mapping of associations. It is applied to the owning side of an association. A join table is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks.
This is what I needed to hear.
I provided answer to your question. Now you need to try. You need to create two entities and make a one-to-many-many-to-one relations between them. Forget about JoinTable.