--
You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group.
To post to this group, send email to fluent-n...@googlegroups.com.
To unsubscribe from this group, send email to fluent-nhibern...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=.
To unsubscribe from this group, send email to fluent-nhibern...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group.
To post to this group, send email to fluent-n...@googlegroups.com.
To unsubscribe from this group, send email to fluent-nhibern...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.
--
You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group.
To post to this group, send email to fluent-n...@googlegroups.com.
To unsubscribe from this group, send email to fluent-nhibern...@googlegroups.com.
On Dec 16, 4:57 pm, Paul Batum <paul.ba...@gmail.com> wrote:
> Would we?
>
> To be honest I'm skeptical about whether the extra complexity would be worth
> it in this case.
Thanks for clarifying. I asked because if you and James thought it
was a simple change, I would have looked into attempting it myself.
Realistically, I'm months away from even thinking about digging into
the Fluent source, so I won't worry about it for now.
> In my opinion, if people really want to approach the implementation of their
> application with "all I care about is my object model, I don't want to have
> to think about persistence" attitude,
Like I said, I've come to realize my expectations were somewhat
unrealistic... ;-)
> maybe they should be looking at an
> object oriented database such as db4o <http://www.db4o.com/>.
I had considered using an OO DB, but there seemed to be a rough
consensus (at least on the Internets) that they had not lived up to
their potential, so FNH seemed like a less risky option.
> Working with
> NHibernate makes persistence easy, but I still have to think about my
> relational model and how I want it mapped. Fluent NHibernate makes the
> configuration of NHibernate even easier, but still, *I expect to have to
> think about my relational model and how I want it mapped*.
Again, thanks for clarifying - I wasn't sure what your goals for
Automapping were. Looks like I need to buckle down and educate myself
a bit beyond "knowing just enough to be dangerous" about RDB design.
On Thu, Dec 17, 2009 at 7:46 AM, James Gregory
<jagregory....@gmail.com>
wrote:
> > I was going to write a long winded reply concerning your design decisions,
> > but I think it can more easily be summed up as:
> > If it hurts, don't do it.
> > You're the first person in the life of FNH to need to do this,that should
> > raise alarm bells.
Consider them raised - if I'm going down a bad road, I certainly don't
want to continue. But, like Cliff Vaughn, I'm also having a bit of
trouble understanding how to implement a better alternative.
-Tom
Cliff, did you notice this code fragment in Paul's sample?
public class StoreMap : IAutoMappingOverride<Store>
{
public void Override(AutoMapping<Store> mapping)
{
mapping.HasMany(x => x.Managers)
.Cascade.All()
.Where("(IsManager = 1)");
mapping.HasMany(x => x.Staff)
.Cascade.All()
.Where("(IsManager = 0)");
}
}
Or are you asking a different question?
Also, are you aware of the discussion "An entity with multiple Many-To-
Many lists of the same type?"
http://groups.google.com/group/fluent-nhibernate/browse_thread/thread/302d5f0a11f0fb70/66a0bc50417408aa?hl=en#66a0bc50417408aa
I have not followed this in detail, but it seems to be related.
-Tom
On Dec 17, 9:29 am, cliff vaughn <cliftonfvau...@gmail.com> wrote:
> THanks Paul, but i was hoping to see some mappings to help illustrate the
> point a bit clearer. Specifically, the one to many with flags. I'm
> assuming you'd just have to specify a where clause, but not completely
> sure.
Cliff, did you notice this code fragment in Paul's sample?
public class StoreMap : IAutoMappingOverride<Store>
{
public void Override(AutoMapping<Store> mapping)
{
mapping.HasMany(x => x.Managers)
.Cascade.All()
.Where("(IsManager = 1)");
mapping.HasMany(x => x.Staff)
.Cascade.All()
.Where("(IsManager = 0)");
}
}
Or are you asking a different question?
Also, are you aware of the discussion "An entity with multiple Many-To-
Many lists of the same type?"
http://groups.google.com/group/fluent-nhibernate/browse_thread/thread/302d5f0a11f0fb70/66a0bc50417408aa?hl=en#66a0bc50417408aa
I have not followed this in detail, but it seems to be related.
-Tom
--
You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group.
To post to this group, send email to fluent-n...@googlegroups.com.
To unsubscribe from this group, send email to fluent-nhibern...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.
public class DistributionResult{
....
}
public class LogNormalDistributionResult : DistributionResult {
...
}
public class ContinDistributionResult : DistributionResult {
...
}
public class DlsAppOverlordExportRunData
{
public virtual int Id { get; private set; }
public virtual DateTime StartDateTime { get; set; }
// ... other members omitted for clarity ...
public virtual IList<LogNormalDistributionResult>
LogNormalDistributionResults { get; set; }
public virtual IList<ContinDistributionResult>
ContinDistrbutionResults {get; set; }
// ...
}
I think I'm starting to get this, except for one thing...
You've introduced two new classes that inherit from
DistributionResult, but don't show any members for them. What, if
anything, do I put between the braces?
Also, if it's any help, here's my current implementation of
DistributionResult. (I assume I'll be able to eliminate the SubId
member if I use the new approach?).
public class DistributionResult
{
public virtual int Id { get; private set; } // Required by
NHibernate
// NHibernate cannot automap more than one IList of the same
// type in a class. SubId allows us to add a "Where"
override.
// See class DlsAppOverlordExportRunDataMap.
public virtual int SubId { get; private set; }
public virtual float Value { get; set; }
public virtual float Relative { get; set; }
public virtual float Cumulative { get; set; }
}
Thanks for your help.
-Tom
On Dec 17, 12:09 pm, cliff vaughn <cliftonfvau...@gmail.com> wrote:
> I did notice this, but dismissed it since I don't use auto mappings
I tend to do the opposite, since I try to do everything with
Automapping.
> On second look, it does seem to give me
> what i was after if it works with regular maps.
Can't say for sure, but I strongly suspect that you can. As far as I
can tell, Automapping just builds on the regular mapping
functionality.
I'd like to be able to give you a code fragment that shows the exact
syntax you need (that's the level of detail I always need, it seems :-
( ), but cannot, alas, since I don't use regular mapping.
No doubt someone else will be able to help.
-Tom
-Tom
Martin,
Thanks for your help.
-Tom
--
On Dec 18, 4:22 am, "Martin Hornagold"
<Martin.Hornag...@marstanit.com> wrote:
> In your case you wouldn't need any extra members for the subclasses.
But I still need an Id member in the new classes, correct? i.e.
public class LogNormalDistributionResult : DistributionResult {
public virtual int Id { get; private set; }
}
public class ContinDistributionResult : DistributionResult {
public virtual int Id { get; private set; }
}
Or are you saying that the classes can be totally empty?
-Tom
> For more options, visit this group athttp://groups.google.com/group/fluent-nhibernate?hl=en.- Hide quoted text -
On Dec 18, 7:37 pm, James Gregory <jagregory....@gmail.com> wrote:
> They can be completely empty. They inherit their properties.
Got it - will try this on Monday.
Thanks for the help, everybody.
-Tom
> >> For more options, visit this group athttp://groups.google.com/group/fluent-nhibernate?hl=en.-Hide quoted text -