Okay, I just downloaded r539 from the trunk, Built it in Release mode.
The file size is identical to the one in S#arp Architecture 1.0 RTM
(229 kb).
I added it to my project and put into place the
JoinedSubclassConvention : IJoinedSubclassConvention class code (see
first post), and registered the convention:
public AutoPersistenceModel Generate()
{
AutoPersistenceModel mappings = AutoPersistenceModel
.MapEntitiesFromAssemblyOf<Business>()
.Where(GetAutoMappingFilter)
.ConventionDiscovery.Setup(GetConventions())
.WithSetup(GetSetup())
.UseOverridesFromAssemblyOf<AutoPersistenceModelGenerator>();
return mappings;
}
private Action<IConventionFinder> GetConventions()
{
return c =>
{
c.Add<PrimaryKeyConvention>();
c.Add<ReferenceConvention>();
c.Add<HasManyConvention>();
c.Add<TableNameConvention>();
c.Add<JoinedSubclassConvention>();
};
}
When I run my tests, there's one (part of S#arpArch) that tests
whether Database matches Mappings, and here, as before, the
NotImplementedException is thrown when trying to run the
JoinedSubclassConvention. I can see in the sources files of FNH that
WithTableName on joined subclasses is not implemented. Is there some
other way I should be dealing with this scenario?
I appreciate the help,
- Chris
On Jul 16, 7:15 pm, James Gregory <[email protected]> wrote:
> Have you tried updating your FNH?
>
> On Fri, Jul 17, 2009 at 12:13 AM, Chris Fazeli <[email protected]> wrote:
>
> > I'm looking to use a convention to have the automapper to recognize
> > pluralized table names for joined subclasses.
>
> > At the moment, with the latest build of FNH (in S#arp Architecture 1.0
> > RTM r486), automapping requires that the joined subclass tables be
> > singular named. Furthermore, the PrimaryKeyConvention I have is
> > ignored, and the PKs are expected to be the name of the parent class,
> > singularlized.
>
> > Here's an example:
> > Our database has a pluralized Businesses table with the "BusinessId"
> > convention as the PK, and there are three inheriting tables that
> > should each have PK "BusinessId" and pluralized table names. The
> > matching domain entities all have singular names.
>
> > I tried using this:
> > public class JoinedSubclassConvention : IJoinedSubclassConvention {
> > public bool Accept(IJoinedSubclass subclass) {
> > return true;
> > }
> > public void Apply(IJoinedSubclass subclass) {
> > subclass.WithTableName(Inflector.Net.Inflector.Pluralize
> > (subclass.EntityType.Name));
> > }
> > }
>
> > But WithTableName is Not Implemented. This also doesn't explain why my
> > PrimaryKeyConvention is ignored for these joined subclasses.
>
> > How do I get by this to have my PKs match the parent's PK, and my
> > tables to be pluralized? Any help would be appreciated.
>
> > Cheers,
> > - Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---