-
Notifications
You must be signed in to change notification settings - Fork 684
Add ability to specify idbag (#415) #755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@hazzik would you mind taking a look at my PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds the ability to specify an idbag collection type in FluentNHibernate mappings. Idbag is a type of collection mapping in NHibernate that combines characteristics of a bag with an identifier column for each row. The implementation includes mapping configuration, XML generation, and visitor pattern support.
- Adds
Collection.IdBag
enum value and associated mapping infrastructure - Implements
CollectionIdMapping
class to configure the collection identifier - Adds
AsIdBag()
methods to fluent mapping API with configurable identifier type and generation strategy
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
Collection.cs | Adds IdBag enum value to collection types |
CollectionMapping.cs | Adds support for CollectionId property and IdBag factory method |
CollectionIdMapping.cs | New mapping class for collection identifier configuration |
ToManyBase.cs | Adds fluent AsIdBag() methods for configuring idbag collections |
XmlIdBagWriter.cs | New XML writer for generating idbag elements |
XmlCollectionIdWriter.cs | New XML writer for collection-id elements |
XmlCollectionWriter.cs | Updates collection writer to handle IdBag type |
Visitor classes | Adds support for visiting CollectionIdMapping |
GeneratorBuilder.cs | Refactors default generator logic into reusable method |
CollectionIdPart.cs | New fluent configuration class for collection identifiers |
Test files | Adds comprehensive tests for idbag functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Closes #415
Adds the ability to specify a collection .AsIdBag(). Note that the NHibernate xml mapping model is a little odd: