fluent-nhibernate
fluent-nhibernate copied to clipboard
Table name of automapped value collection isn't correct
The table name that's generated by the automapper for element collections is the property name of the collection. If different entities use the same collection name then there'll be conflicts. We should prefix the table name with the Entity name or something.
can you please provide more detail, I'm not sure I understand the issue
oh, I think I understand - you mean, when automapping entities that contains a collection with the same property name and different element type, these collections are being mapped to the same table? like here: https://gist.github.com/3699969 ?
@chester89 this appears to be exactly it - https://groups.google.com/forum/?fromgroups=#!topic/fluent-nhibernate/g4M1l3S3YWI - there's a one-line fix there which you can patch your code with. Presumably this hasn't been applied due to the risk of breaking existing code.
Is there any way I can achieve the same thing with a convention?
implementing ICollectionConvention would be it, but i don't know how to know if the collection is a element collection (maybe instance.Element is null or something)
This is a breaking change, so it'll have to wait until 2.0