After a day of beating the desk, I figured I'd toss this out and see where
I've gone astray. :)
I have two fluent configurations... one to our primary business application
that contains a mapping to an object (a "school" object) and a second that
is for a secondary system I'm developing that needs to create a list of
objects based on the mapping from that primary app.
In the entity object "BuildingUser":
public virtual IList<School> BuildingUserSchools { get; set; }
School is part of another database; that database is being initialized prior
to this secondary database, so the mapping files for "School" should be
available.
In the BuildingUserMap file:
HasManyToMany(x => x.BuildingUserSchools)
.WithTableName("BuildingUserSchools")
.WithParentKeyColumn("Id")
.WithChildKeyColumn("BuildingUserId")
.FetchType.Join();
I've tried explicitly setting ".CollectionType(typeof (School))" to no
avail. It seems there should be a property to say "when building a school
object, you need to know the BuildingUserSchools.SchoolId column..."
When initializing the fluent configuration, the mappings are using standard
fluent mappings:
.Mappings(mappings => mappings
.FluentMappings
.AddFromAssemblyOf<AssessmentMap>());
Trying to init that configuration, however, returns the following error:
"An association from the table BuildingUserSchools refers to an unmapped
class: USD259.Domain.Sis.School"
As I mentioned prior, the fluent configuration that maps
USD259.Domain.Sis.School is initializing just fine; I can return School
objects without any issues; however, it seems the second "Assessment"
configuration isn't aware that the first exists.
So the question: Is there a way to tell one fluent configuration that
another, already initialized mapping configuration is available and to use
it's mappings for objects? e.g.
(fluent config #1) NewApplication.Assessment.BuildingUserSchools
is a
(fluent config #2) IList<USD259.Domain.Sis.School>
I keep having this sinking feeling that for each of the fluent mappings to
be "aware" of each other, they each have to map each other...
Is there a better way to do this?
Thanks in advance!
-dl
David R. Longnecker
Blog <http://blog.tiredstudent.com/> |
Twitter<http://www.twitter.com/dlongnecker>|
LinkedIn <http://www.linkedin.com/in/davidlongnecker>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---