Re: [fluent-nhib] Many To Many mapping to only remove relationship

2010-07-06 Thread Buddy Lindsey, Jr.
No the order doesn't matter so I like the idea of using an ICollection or
ISet never thought of that.

The problem I am having is I don't know what the proper mapping is for these
3 tables. I have tried several compinations so it is kind of hard to explain
which results are giving me what, but some of the issues I have had are:

1) I can add a show and genres by passing the show object with genres inside
and running the Save() method. It saves both the show and the genres.
However, when I try to add genres by getting the show object and adding more
genre objects to the genres collection and do an update() it doesn't save
the new genres to the database.

2) I can add shows to a DB with genres and delete show and the relationship
and keep the genre, but I can't delete a genre explicitly and the
relationship of it and the show, without deleting the show too.

I have to delete a relationship itself without deleting the a show or a
genre. Or if i delete a show I need it to delete the show and the
relationship with a genre.

If I delete a genre I need it to delete the genre and the relationship with
a show, but not the show.

I can't seem to get the mapping correct to do this. And from there should I
even be doing a hasmanytomany mapping or something different altogether
mapping wise?

---
Buddy Lindsey
http://www.buddylindsey.com
http://www.twitter.com/buddylindsey


2010/7/6 Oskar Berggren 

> Is the order of Genres assigned to shows important to you? If it is,
> you will need a column in the database to store the index. If it
> isn't, don't use an indexed interface like IList<>, use ICollection<>
> or ISet<> instead.
>
> Apart from that, what problems are you experiencing?
>
> /Oskar
>

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.



Re: [fluent-nhib] Many To Many mapping to only remove relationship

2010-07-06 Thread Oskar Berggren
Is the order of Genres assigned to shows important to you? If it is,
you will need a column in the database to store the index. If it
isn't, don't use an indexed interface like IList<>, use ICollection<>
or ISet<> instead.

Apart from that, what problems are you experiencing?

/Oskar



2010/7/6 Buddy Lindsey, Jr. :
> I posted this on StackOverflow, since I usually get a decently quick
> response, but had several views and it is either confusing or a difficult
> problem or I can't explain it at all. I figured i'd give this mailing list a
> shot, not ever asked a question on one before. So here goes:
>
> Here is my Database Strucutre:
>
> Shows
> ID
> Name
>
> Genres
> ID
> Name
>
>
> ShowsGenres
> ShowsID
> GenresID
>
> Above is my Database I am trying to figure out how to map this properly. My
> Show object is like this:
>
> public class Show
> {
>
>     public virtual int ID { get; set; }
>
> public virtual string Name { get; set; }
>
> public virtual IList Genres { get; set; }
>
> }
>
> My Genre Object is:
>
> public class Genre
> {
>
>     public virtual int ID { get; set; }
>
>     public virtual string Name { get; set; }
>
>     public virtual IList Shows { get; set; }
>
> }
>
> I have tried several different variations of HasManyToMany, but none work
> the way I want them to.
>
> I need to be able to delete a show and the relationship with the genre, or
> many genres, but not delete the genre(s).
>
> I need to be able to delete a genre and its relationship with a show, or
> many shows, but not delete the show(s).
>
> I would also need to be able to remove the relationship between a show and a
> genre without removing the show or the genre.
>
> How can I map this or do I need to try something differently?
>
> Thanks,
> Buddy
>
> ---
> Buddy Lindsey
> http://www.buddylindsey.com
> http://www.twitter.com/buddylindsey
>
> --
> You received this message because you are subscribed to the Google Groups
> "Fluent NHibernate" group.
> To post to this group, send email to fluent-nhibern...@googlegroups.com.
> To unsubscribe from this group, send email to
> fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.



[fluent-nhib] Many To Many mapping to only remove relationship

2010-07-06 Thread Buddy Lindsey, Jr.
I posted this on StackOverflow, since I usually get a decently quick
response, but had several views and it is either confusing or a difficult
problem or I can't explain it at all. I figured i'd give this mailing list a
shot, not ever asked a question on one before. So here goes:

Here is my Database Strucutre:

Shows
ID
Name

Genres
ID
Name

ShowsGenres
ShowsID
GenresID

Above is my Database I am trying to figure out how to map this properly. My
Show object is like this:

public class Show
{
public virtual int ID { get; set; }
public virtual string Name { get; set; }
public virtual IList Genres { get; set; }
}

My Genre Object is:

public class Genre
{
public virtual int ID { get; set; }
public virtual string Name { get; set; }
public virtual IList Shows { get; set; }
}

I have tried several different variations of HasManyToMany, but none work
the way I want them to.

I need to be able to delete a show and the relationship with the genre, or
many genres, but not delete the genre(s).

I need to be able to delete a genre and its relationship with a show, or
many shows, but not delete the show(s).

I would also need to be able to remove the relationship between a show and a
genre without removing the show or the genre.

How can I map this or do I need to try something differently?

Thanks,
Buddy

---
Buddy Lindsey
http://www.buddylindsey.com
http://www.twitter.com/buddylindsey

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.



Re: [fluent-nhib] How can I automap HasManyToMany ?

2010-07-06 Thread Yann ROBIN
Found my answer.

Just need to override DefaultAutomappingConfiguration and to replace
HasManyToManyStep :)


On Tue, Jul 6, 2010 at 2:22 PM, Yann ROBIN  wrote:
> In my case i don't have a collection on the child too.
> If the child is in another assembly you can't do that (cycling reference).
>
> Can I can custom this rule ?
>
> On Tue, Jul 6, 2010 at 2:15 PM, James Gregory  wrote:
>> It will do it automatically, if it can find a collection on the child too.
>> Is it not working?
>>
>> On Tue, Jul 6, 2010 at 10:44 AM, Yann ROBIN  wrote:
>>>
>>> Hi,
>>>
>>> I want fluent-nhibernate to be able to detect that a relation is a
>>> HasManyToMany and not a HasMany (using automapping).
>>> How can i do that without needing to explicitly specify that it is a
>>> HasManyToMany.
>>>
>>> (I want to set a rule like : if not in same assembly or child type
>>> name is Category)
>>>
>>> Thanks,
>>>
>>> --
>>> Yann
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Fluent NHibernate" group.
>>> To post to this group, send email to fluent-nhibern...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> fluent-nhibernate+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/fluent-nhibernate?hl=en.
>>
>
>
>
> --
> Yann
>



-- 
Yann

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.



Re: [fluent-nhib] Re: How to convert this to fluent

2010-07-06 Thread Paul Batum
Unfortunately C# is a leaky umbrella - its impossible to always stay DRY
with it :)

There might be some tricks using other tools such as PostSharp that can
address these sorts of problems but I haven't really investigated it.

On Tue, Jul 6, 2010 at 11:37 PM, mynkow  wrote:

> Yes, this is an option. But I am trying to stay DRY. I have many
> collections and I will be forced to write those line many times. Any
> idea how to do it DRY
>
> On Jul 6, 3:07 pm, Paul Batum  wrote:
> > I usually do something like this:
> >
> > public class Customer
> > {
> >
> >   private IList _orders;
> >
> >   public Customer()
> >   {
> > _orders = new List();
> >   }
> >
> >   public IEnumerable Orders { get { return _orders; } }
> >
> >   public void AddOrder(Order o)
> >   {
> >  o.Customer = this;
> >  _orders.Add(o);
> >   }
> >
> > }
> > On Tue, Jul 6, 2010 at 9:50 PM, mynkow  wrote:
> > > Component>( x => x.Departments, m =>
> > > { m.HasMany(
> Reveal.Member>(
> > > "_internalCollection" ) ).Access.Field() .KeyColumn( "DepartmentOrgId"
> )
> > > .ForeignKeyConstraintName( "FK_OrgDepartment" ).AsSet(); } );
> >
> > > This is what I did after all. But I need some advices how to manage
> > > collections with NHibernate. Many people advice me to use ISet,
> > > IEnumerable, IList etc. for collections and avoid custom collections.
> > > And may be this is a good approach. But here is the question: Should I
> > > always use IEnumerable for my collections and if yes how to add new
> > > Items to the collection when adding an element will result to new
> > > IEnumerable collection? Can Nhibernate can keep track of the
> > > collection items in this situation? I do not know. I am so confused
> > > right now.
> >
> > > On Jul 5, 2:47 pm, Paul Batum  wrote:
> > > > Off the top of my head I would have though you could do something
> like:
> >
> > > > Component(x => x.Departments, c =>
> > > >c.HasMany(Reveal.Member("_internalCollection"))
> > > >  .Table("DEPARTMENT")
> > > >  .Cascade.SaveUpdate
> > > >  .Access.Field
> > > >  .KeyColumn("DepartmentOrgId")
> > > >  .ForeignKey("FK_OrgDepartment")
> > > > );
> >
> > > > My syntax might be slightly off but I thought this would work... if
> not,
> > > can
> > > > you provide more detail on why?
> >
> > > > On Sun, Jul 4, 2010 at 3:35 PM, mynkow  wrote:
> > > > > Hi, I have troubles converting this xml mapping part to fluent.
> Please
> > > > > help me
> >
> > > > >  >
> > >
> class="Core.Domain.Collections.EntitySet`1[Core.Domain.OrgStructure.IDepartmentEntity,BusinessWare.Core],Core">
> > > > > > > > > cascade="save-update" access="field" generic="true" lazy="true" >
> > > > >   > > > > key="FK_OrgDepartment" />
> > > > >   > > > > class="Domain.Model.OrgStructure.DepartmentEntity,Domain"/>
> > > > >
> > > > >  
> >
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > Groups
> > > > > "Fluent NHibernate" group.
> > > > > To post to this group, send email to
> > > fluent-nhibern...@googlegroups.com.
> > > > > To unsubscribe from this group, send email to
> > > > > fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
> To unsubscribe from this group, send email to
> fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.



Re: [fluent-nhib] Firebird

2010-07-06 Thread Bruno Costa
Paul,

I could resolve the problem:

Id(x => x.Id)
   .GeneratedBy.*Native*("Cli_Generator")


Thanks

 Bruno

2010/7/6 Paul Batum 

> I do not recognise that error message. Can you please provide a full stack
> trace of the exception.
>
>
> On Mon, Jul 5, 2010 at 11:56 PM, Bruno Costa wrote:
>
>> I put like this:
>>
>> Id(x => x.Id)
>>.GeneratedBy.Custom("Cli_Generator")
>>
>> But, an error is happening: "Fluent Nhibernate Could Not Interpret id
>> Generator Strategy: "Cli_Generator".
>>
>> I dont't know why
>>
>>
>> 2010/7/5 Bruno Costa 
>>
>> Ok, thanks!
>>>
>>> I already have a generator made for me in my database, called
>>> "Cli_Generator". How can I map my class to Id be generated for this exists
>>> generator?
>>>
>>>
>>>  Bruno
>>>
>>> 2010/7/5 Paul Batum 
>>>
>>> I haven't used firebird before but my impression was that you could use
 our existing FirebirdConfiguration class like this:

 Fluently.Configure()
 .Database(new
 FirebirdConfiguration().ConnectionString(myConnectionString))
 .Mappings(m => ... normal stuff goes here)

 On Mon, Jul 5, 2010 at 8:07 PM, Bruno Costa 
 wrote:

> Hi guys,
>
> Anyone ever have used FluentNhib with Firebird? I'm not getting do
> this...
>
> In configuration, what I put? FluentHelper.???
>
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Fluent NHibernate" group.
> To post to this group, send email to
> fluent-nhibern...@googlegroups.com.
> To unsubscribe from this group, send email to
> fluent-nhibernate+unsubscr...@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-nhibernate@googlegroups.com
 .
 To unsubscribe from this group, send email to
 fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
> To unsubscribe from this group, send email to
> fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.



[fluent-nhib] Re: How to convert this to fluent

2010-07-06 Thread mynkow
Yes, this is an option. But I am trying to stay DRY. I have many
collections and I will be forced to write those line many times. Any
idea how to do it DRY

On Jul 6, 3:07 pm, Paul Batum  wrote:
> I usually do something like this:
>
> public class Customer
> {
>
>   private IList _orders;
>
>   public Customer()
>   {
>     _orders = new List();
>   }
>
>   public IEnumerable Orders { get { return _orders; } }
>
>   public void AddOrder(Order o)
>   {
>      o.Customer = this;
>      _orders.Add(o);
>   }
>
> }
> On Tue, Jul 6, 2010 at 9:50 PM, mynkow  wrote:
> > Component>( x => x.Departments, m =>
> > { m.HasMany( Reveal.Member>(
> > "_internalCollection" ) ).Access.Field() .KeyColumn( "DepartmentOrgId" )
> > .ForeignKeyConstraintName( "FK_OrgDepartment" ).AsSet(); } );
>
> > This is what I did after all. But I need some advices how to manage
> > collections with NHibernate. Many people advice me to use ISet,
> > IEnumerable, IList etc. for collections and avoid custom collections.
> > And may be this is a good approach. But here is the question: Should I
> > always use IEnumerable for my collections and if yes how to add new
> > Items to the collection when adding an element will result to new
> > IEnumerable collection? Can Nhibernate can keep track of the
> > collection items in this situation? I do not know. I am so confused
> > right now.
>
> > On Jul 5, 2:47 pm, Paul Batum  wrote:
> > > Off the top of my head I would have though you could do something like:
>
> > > Component(x => x.Departments, c =>
> > >    c.HasMany(Reveal.Member("_internalCollection"))
> > >      .Table("DEPARTMENT")
> > >      .Cascade.SaveUpdate
> > >      .Access.Field
> > >      .KeyColumn("DepartmentOrgId")
> > >      .ForeignKey("FK_OrgDepartment")
> > > );
>
> > > My syntax might be slightly off but I thought this would work... if not,
> > can
> > > you provide more detail on why?
>
> > > On Sun, Jul 4, 2010 at 3:35 PM, mynkow  wrote:
> > > > Hi, I have troubles converting this xml mapping part to fluent. Please
> > > > help me
>
> > > > 
> > class="Core.Domain.Collections.EntitySet`1[Core.Domain.OrgStructure.IDepartmentEntity,BusinessWare.Core],Core">
> > > >         > > > cascade="save-update" access="field" generic="true" lazy="true" >
> > > >           > > > key="FK_OrgDepartment" />
> > > >           > > > class="Domain.Model.OrgStructure.DepartmentEntity,Domain"/>
> > > >        
> > > >      
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Fluent NHibernate" group.
> > > > To post to this group, send email to
> > fluent-nhibern...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.



Re: [fluent-nhib] How can I automap HasManyToMany ?

2010-07-06 Thread Yann ROBIN
In my case i don't have a collection on the child too.
If the child is in another assembly you can't do that (cycling reference).

Can I can custom this rule ?

On Tue, Jul 6, 2010 at 2:15 PM, James Gregory  wrote:
> It will do it automatically, if it can find a collection on the child too.
> Is it not working?
>
> On Tue, Jul 6, 2010 at 10:44 AM, Yann ROBIN  wrote:
>>
>> Hi,
>>
>> I want fluent-nhibernate to be able to detect that a relation is a
>> HasManyToMany and not a HasMany (using automapping).
>> How can i do that without needing to explicitly specify that it is a
>> HasManyToMany.
>>
>> (I want to set a rule like : if not in same assembly or child type
>> name is Category)
>>
>> Thanks,
>>
>> --
>> Yann
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Fluent NHibernate" group.
>> To post to this group, send email to fluent-nhibern...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
> To unsubscribe from this group, send email to
> fluent-nhibernate+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/fluent-nhibernate?hl=en.
>



-- 
Yann

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.



Re: [fluent-nhib] How can I automap HasManyToMany ?

2010-07-06 Thread James Gregory
It will do it automatically, if it can find a collection on the child too.
Is it not working?

On Tue, Jul 6, 2010 at 10:44 AM, Yann ROBIN  wrote:

> Hi,
>
> I want fluent-nhibernate to be able to detect that a relation is a
> HasManyToMany and not a HasMany (using automapping).
> How can i do that without needing to explicitly specify that it is a
> HasManyToMany.
>
> (I want to set a rule like : if not in same assembly or child type
> name is Category)
>
> Thanks,
>
> --
> Yann
>
> --
> You received this message because you are subscribed to the Google Groups
> "Fluent NHibernate" group.
> To post to this group, send email to fluent-nhibern...@googlegroups.com.
> To unsubscribe from this group, send email to
> fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.



Re: [fluent-nhib] Re: How to convert this to fluent

2010-07-06 Thread Paul Batum
I usually do something like this:

public class Customer
{

  private IList _orders;

  public Customer()
  {
_orders = new List();
  }

  public IEnumerable Orders { get { return _orders; } }

  public void AddOrder(Order o)
  {
 o.Customer = this;
 _orders.Add(o);
  }
}



On Tue, Jul 6, 2010 at 9:50 PM, mynkow  wrote:

> Component>( x => x.Departments, m =>
> { m.HasMany( Reveal.Member>(
> "_internalCollection" ) ).Access.Field() .KeyColumn( "DepartmentOrgId" )
> .ForeignKeyConstraintName( "FK_OrgDepartment" ).AsSet(); } );
>
> This is what I did after all. But I need some advices how to manage
> collections with NHibernate. Many people advice me to use ISet,
> IEnumerable, IList etc. for collections and avoid custom collections.
> And may be this is a good approach. But here is the question: Should I
> always use IEnumerable for my collections and if yes how to add new
> Items to the collection when adding an element will result to new
> IEnumerable collection? Can Nhibernate can keep track of the
> collection items in this situation? I do not know. I am so confused
> right now.
>
> On Jul 5, 2:47 pm, Paul Batum  wrote:
> > Off the top of my head I would have though you could do something like:
> >
> > Component(x => x.Departments, c =>
> >c.HasMany(Reveal.Member("_internalCollection"))
> >  .Table("DEPARTMENT")
> >  .Cascade.SaveUpdate
> >  .Access.Field
> >  .KeyColumn("DepartmentOrgId")
> >  .ForeignKey("FK_OrgDepartment")
> > );
> >
> > My syntax might be slightly off but I thought this would work... if not,
> can
> > you provide more detail on why?
> >
> > On Sun, Jul 4, 2010 at 3:35 PM, mynkow  wrote:
> > > Hi, I have troubles converting this xml mapping part to fluent. Please
> > > help me
> >
> > >  >
> > >
> class="Core.Domain.Collections.EntitySet`1[Core.Domain.OrgStructure.IDepartmentEntity,BusinessWare.Core],Core">
> > > > > cascade="save-update" access="field" generic="true" lazy="true" >
> > >   > > key="FK_OrgDepartment" />
> > >   > > class="Domain.Model.OrgStructure.DepartmentEntity,Domain"/>
> > >
> > >  
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Fluent NHibernate" group.
> > > To post to this group, send email to
> fluent-nhibern...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
> To unsubscribe from this group, send email to
> fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.



[fluent-nhib] Re: How to convert this to fluent

2010-07-06 Thread mynkow
Component>( x => x.Departments, m =>
{ m.HasMany( Reveal.Member>( 
"_internalCollection" ) ).Access.Field() .KeyColumn( "DepartmentOrgId" ) 
.ForeignKeyConstraintName( "FK_OrgDepartment" ).AsSet(); } );

This is what I did after all. But I need some advices how to manage
collections with NHibernate. Many people advice me to use ISet,
IEnumerable, IList etc. for collections and avoid custom collections.
And may be this is a good approach. But here is the question: Should I
always use IEnumerable for my collections and if yes how to add new
Items to the collection when adding an element will result to new
IEnumerable collection? Can Nhibernate can keep track of the
collection items in this situation? I do not know. I am so confused
right now.

On Jul 5, 2:47 pm, Paul Batum  wrote:
> Off the top of my head I would have though you could do something like:
>
> Component(x => x.Departments, c =>
>    c.HasMany(Reveal.Member("_internalCollection"))
>      .Table("DEPARTMENT")
>      .Cascade.SaveUpdate
>      .Access.Field
>      .KeyColumn("DepartmentOrgId")
>      .ForeignKey("FK_OrgDepartment")
> );
>
> My syntax might be slightly off but I thought this would work... if not, can
> you provide more detail on why?
>
> On Sun, Jul 4, 2010 at 3:35 PM, mynkow  wrote:
> > Hi, I have troubles converting this xml mapping part to fluent. Please
> > help me
>
> > 
> > class="Core.Domain.Collections.EntitySet`1[Core.Domain.OrgStructure.IDepartmentEntity,BusinessWare.Core],Core">
> >         > cascade="save-update" access="field" generic="true" lazy="true" >
> >           > key="FK_OrgDepartment" />
> >           > class="Domain.Model.OrgStructure.DepartmentEntity,Domain"/>
> >        
> >      
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Fluent NHibernate" group.
> > To post to this group, send email to fluent-nhibern...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.



Re: [fluent-nhib] Firebird

2010-07-06 Thread Paul Batum
I do not recognise that error message. Can you please provide a full stack
trace of the exception.

On Mon, Jul 5, 2010 at 11:56 PM, Bruno Costa wrote:

> I put like this:
>
> Id(x => x.Id)
>.GeneratedBy.Custom("Cli_Generator")
>
> But, an error is happening: "Fluent Nhibernate Could Not Interpret id
> Generator Strategy: "Cli_Generator".
>
> I dont't know why
>
>
> 2010/7/5 Bruno Costa 
>
> Ok, thanks!
>>
>> I already have a generator made for me in my database, called
>> "Cli_Generator". How can I map my class to Id be generated for this exists
>> generator?
>>
>>
>>  Bruno
>>
>> 2010/7/5 Paul Batum 
>>
>> I haven't used firebird before but my impression was that you could use
>>> our existing FirebirdConfiguration class like this:
>>>
>>> Fluently.Configure()
>>> .Database(new
>>> FirebirdConfiguration().ConnectionString(myConnectionString))
>>> .Mappings(m => ... normal stuff goes here)
>>>
>>> On Mon, Jul 5, 2010 at 8:07 PM, Bruno Costa wrote:
>>>
 Hi guys,

 Anyone ever have used FluentNhib with Firebird? I'm not getting do
 this...

 In configuration, what I put? FluentHelper.???


 Thanks!

 --
 You received this message because you are subscribed to the Google
 Groups "Fluent NHibernate" group.
 To post to this group, send email to fluent-nhibernate@googlegroups.com
 .
 To unsubscribe from this group, send email to
 fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
> To unsubscribe from this group, send email to
> fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.



Re: [fluent-nhib] fluent nh wiki

2010-07-06 Thread Luis Abreu
Hello James.

ah, I see.

it's been a long time since I used fluent nh (in fact, it seems like
my project was still running with a really old release) so I didn't
notice that.

I guess that explains the initial error I was getting which involved
the name of the class.

still regarding the docs, wouldn't it be better to add a note
mentioning that so that guys like me (or others that are getting
started) don't get lost while trying to use subclasses? just asking...

thanks again


On Tue, Jul 6, 2010 at 11:58 AM, James Gregory  wrote:
> Nope, not if you don't want to. Discriminators default to using the class
> name as the discriminator value.
>
> On Tue, Jul 6, 2010 at 11:51 AM, Luis Abreu  wrote:
>>
>> Hello guys.
>>
>> I'm reading the wiki: http://wiki.fluentnhibernate.org/Fluent_mapping
>>
>> and I've got a question on the table-per-hierachy mapping shown at the
>> end of the page.Don't you need to specify the discriminator value for
>> each derived class? I'm not seein that on the example that is shown.
>>
>> thanks.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Fluent NHibernate" group.
>> To post to this group, send email to fluent-nhibern...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
> To unsubscribe from this group, send email to
> fluent-nhibernate+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/fluent-nhibernate?hl=en.
>



-- 
Regards,
Luis Abreu

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.



Re: [fluent-nhib] fluent nh wiki

2010-07-06 Thread James Gregory
Nope, not if you don't want to. Discriminators default to using the class
name as the discriminator value.

On Tue, Jul 6, 2010 at 11:51 AM, Luis Abreu  wrote:

> Hello guys.
>
> I'm reading the wiki: http://wiki.fluentnhibernate.org/Fluent_mapping
>
> and I've got a question on the table-per-hierachy mapping shown at the
> end of the page.Don't you need to specify the discriminator value for
> each derived class? I'm not seein that on the example that is shown.
>
> thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Fluent NHibernate" group.
> To post to this group, send email to fluent-nhibern...@googlegroups.com.
> To unsubscribe from this group, send email to
> fluent-nhibernate+unsubscr...@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-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.



[fluent-nhib] fluent nh wiki

2010-07-06 Thread Luis Abreu
Hello guys.

I'm reading the wiki: http://wiki.fluentnhibernate.org/Fluent_mapping

and I've got a question on the table-per-hierachy mapping shown at the
end of the page.Don't you need to specify the discriminator value for
each derived class? I'm not seein that on the example that is shown.

thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.



[fluent-nhib] How can I automap HasManyToMany ?

2010-07-06 Thread Yann ROBIN
Hi,

I want fluent-nhibernate to be able to detect that a relation is a
HasManyToMany and not a HasMany (using automapping).
How can i do that without needing to explicitly specify that it is a
HasManyToMany.

(I want to set a rule like : if not in same assembly or child type
name is Category)

Thanks,

-- 
Yann

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.