buggins / hibernated

HibernateD is ORM for D language (similar to Hibernate)
82 stars 31 forks source link

Add initial support for @EmbeddedId, permitting composite keys. #88

Closed vnayar closed 5 months ago

vnayar commented 6 months ago

More work will be needed to support @OneToMany and @ManyToOne using a composite key, the JPA @JoinColumns annotation will be needed to support this. However, with this change, at least some options exist for dealing with composite-keys rather than just facing a brick wall.

See https://github.com/buggins/hibernated/issues/85

vnayar commented 6 months ago

@SingingBush Let me know if there are any gaps or things to be added before this can be merged. There are a few gaps that I'm aware of at the moment including:

However, the feature adds value even in its current form, as it allows representation of existing databases that use compound keys, something not possible before.

SingingBush commented 6 months ago

The limitations seem ok as long as it's clearly documented. Could you add some details to the readme about the support for composite keys.

vnayar commented 5 months ago

README updated with notes about the current state of implementation. More work will of course come to address these shortcomings as time permits.