[fluent-nhib] Re: ITypeConvention.CanHandle(Type)

2009-01-14 Thread James Gregory
Committed the fix to expose an AddPropertyConvention on the Conventions
class. Working on the other conventions now.

On Wed, Jan 14, 2009 at 10:20 PM, James Gregory wrote:

> I'm going to expose the IPropertyConvention, then set at creating some more
> specialised conventions.
>
>
> On Wed, Jan 14, 2009 at 10:20 PM, James Gregory 
> wrote:
>
>> Brought this back to the list...
>>
>> I'm not too concerned with the current convention interfaces. I need to
>> put some more thought into it, but I see the main problems as:
>> ITypeConvention only operates against property's, which means it's very
>> similar to IPropertyConvention; however, ITypeConvention should really work
>> against ANY mapping that has the particular type. If that was the case, then
>> the similarity between the two is certainly a lot less. Then there'd be
>> variations on IPropertyConvention for each particular mapping. I see it
>> being something like this:
>> interface ITypeConvention
>> {
>>   bool CanHandle(Type type);
>>   void AlterMapping(IMapping mapping);
>> }
>>
>> interface IPropertyConvention { ... }
>> interface IIdConvention { ... }
>> interface IHasManyConvention { ... }
>>
>> This does lead to a less genericised model, which will mean more classes
>> and work on our side, but it should give more power to the user.
>>
>> On Wed, Jan 14, 2009 at 9:50 PM, ch...@marisic.com wrote:
>>
>>>
>>> Great my post got eaten by google...
>>>
>>> Looking up IPropertyConvention, this behaves quite differnetly than
>>> ITypeConvention CanHandle/AlterMap vs a single Process method, the
>>> only usage is for the AttributeConvention class. the
>>> List collection is private and can only be
>>> accessed by the ForAttribute(Action action) method.
>>>
>>> Is there a reason that ITypeConvention and IPropertyConvention are so
>>> different in these aspects?
>>> >>>
>>>
>>
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[fluent-nhib] Re: ITypeConvention.CanHandle(Type)

2009-01-14 Thread James Gregory
I'm going to expose the IPropertyConvention, then set at creating some more
specialised conventions.

On Wed, Jan 14, 2009 at 10:20 PM, James Gregory wrote:

> Brought this back to the list...
>
> I'm not too concerned with the current convention interfaces. I need to put
> some more thought into it, but I see the main problems as: ITypeConvention
> only operates against property's, which means it's very similar to
> IPropertyConvention; however, ITypeConvention should really work against ANY
> mapping that has the particular type. If that was the case, then the
> similarity between the two is certainly a lot less. Then there'd be
> variations on IPropertyConvention for each particular mapping. I see it
> being something like this:
> interface ITypeConvention
> {
>   bool CanHandle(Type type);
>   void AlterMapping(IMapping mapping);
> }
>
> interface IPropertyConvention { ... }
> interface IIdConvention { ... }
> interface IHasManyConvention { ... }
>
> This does lead to a less genericised model, which will mean more classes
> and work on our side, but it should give more power to the user.
>
> On Wed, Jan 14, 2009 at 9:50 PM, ch...@marisic.com wrote:
>
>>
>> Great my post got eaten by google...
>>
>> Looking up IPropertyConvention, this behaves quite differnetly than
>> ITypeConvention CanHandle/AlterMap vs a single Process method, the
>> only usage is for the AttributeConvention class. the
>> List collection is private and can only be
>> accessed by the ForAttribute(Action action) method.
>>
>> Is there a reason that ITypeConvention and IPropertyConvention are so
>> different in these aspects?
>> >>
>>
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[fluent-nhib] Re: ITypeConvention.CanHandle(Type)

2009-01-14 Thread James Gregory
Brought this back to the list...

I'm not too concerned with the current convention interfaces. I need to put
some more thought into it, but I see the main problems as: ITypeConvention
only operates against property's, which means it's very similar to
IPropertyConvention; however, ITypeConvention should really work against ANY
mapping that has the particular type. If that was the case, then the
similarity between the two is certainly a lot less. Then there'd be
variations on IPropertyConvention for each particular mapping. I see it
being something like this:
interface ITypeConvention
{
  bool CanHandle(Type type);
  void AlterMapping(IMapping mapping);
}

interface IPropertyConvention { ... }
interface IIdConvention { ... }
interface IHasManyConvention { ... }

This does lead to a less genericised model, which will mean more classes and
work on our side, but it should give more power to the user.

On Wed, Jan 14, 2009 at 9:50 PM, ch...@marisic.com wrote:

>
> Great my post got eaten by google...
>
> Looking up IPropertyConvention, this behaves quite differnetly than
> ITypeConvention CanHandle/AlterMap vs a single Process method, the
> only usage is for the AttributeConvention class. the
> List collection is private and can only be
> accessed by the ForAttribute(Action action) method.
>
> Is there a reason that ITypeConvention and IPropertyConvention are so
> different in these aspects?
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[fluent-nhib] Re: ITypeConvention.CanHandle(Type)

2009-01-14 Thread ch...@marisic.com

Great my post got eaten by google...

Looking up IPropertyConvention, this behaves quite differnetly than
ITypeConvention CanHandle/AlterMap vs a single Process method, the
only usage is for the AttributeConvention class. the
List collection is private and can only be
accessed by the ForAttribute(Action action) method.

Is there a reason that ITypeConvention and IPropertyConvention are so
different in these aspects?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[fluent-nhib] Re: ITypeConvention.CanHandle(Type)

2009-01-14 Thread James Gregory
Well, ITypeConvention kind of implies a type, don't you think? :)
There's already an IPropertyConvention, which you can probably make use of;
there's an AttributeConvention you could probably use for reference. I've
yet to write anything up on it yet though.

On Wed, Jan 14, 2009 at 8:09 PM, ch...@marisic.com wrote:

>
> I think ITypeConvention.CanHandle should take the IProperty interface
> instead of just a type.
>
> I have a ITypeConvention implementation
>
>public class TypePrependsFieldName : ITypeConvention
>{
>private readonly string _fieldName;
>
>public TypePrependsFieldName(string fieldName)
>{
>_fieldName = fieldName;
>}
>
>public bool CanHandle(Type type)
>{
>return type == typeof (T);
>}
>
>public void AlterMap(IProperty propertyMapping)
>{
>if (propertyMapping.Property.Name != _fieldName) return;
>
>propertyMapping.TheColumnNameIs
> (propertyMapping.ParentType.Name + propertyMapping.Property.Name);
>}
>}
>
> So that I can add the following conventions
>
> convention.AddTypeConvention(new TypePrependsFieldName
> ("Name"));
> convention.AddTypeConvention(new TypePrependsFieldName
> ("Description"));
>
> However since
>
> Conventions.cs
>public ITypeConvention FindConvention(Type propertyType)
>{
>var find = _typeConventions.Find(c => c.CanHandle
> (propertyType));
>return find ?? new DefaultConvention();
>}
>
> uses the Type, it only finds the first TypePrependsFieldName class
> because it thinks it can handle the property, but it can't because it
> doesn't know until AlterMap gets called to check the name of the
> property.
>
> Or at the very least to change it from Type to be PropertyInfo since
> you can always go up to the type anyway since that's exactly what the
> code does that calls FindConvention does anyway
>
> AutoMapColumn.cs
>private bool HasExplicitTypeConvention(PropertyInfo property)
>{
>var convention = conventions.FindConvention
> (property.PropertyType);
> 
> }
>
> I know this would be a breaking change but it's very hard to figure
> out if the Convention can handle the type unless you end up creating a
> very complex AlterMap method and have to merge a bunch of classes
> together as opposed to being able to add ones like I did using a
> little bit of generics.
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[fluent-nhib] ITypeConvention.CanHandle(Type)

2009-01-14 Thread ch...@marisic.com

I think ITypeConvention.CanHandle should take the IProperty interface
instead of just a type.

I have a ITypeConvention implementation

public class TypePrependsFieldName : ITypeConvention
{
private readonly string _fieldName;

public TypePrependsFieldName(string fieldName)
{
_fieldName = fieldName;
}

public bool CanHandle(Type type)
{
return type == typeof (T);
}

public void AlterMap(IProperty propertyMapping)
{
if (propertyMapping.Property.Name != _fieldName) return;

propertyMapping.TheColumnNameIs
(propertyMapping.ParentType.Name + propertyMapping.Property.Name);
}
}

So that I can add the following conventions

convention.AddTypeConvention(new TypePrependsFieldName
("Name"));
convention.AddTypeConvention(new TypePrependsFieldName
("Description"));

However since

Conventions.cs
public ITypeConvention FindConvention(Type propertyType)
{
var find = _typeConventions.Find(c => c.CanHandle
(propertyType));
return find ?? new DefaultConvention();
}

uses the Type, it only finds the first TypePrependsFieldName class
because it thinks it can handle the property, but it can't because it
doesn't know until AlterMap gets called to check the name of the
property.

Or at the very least to change it from Type to be PropertyInfo since
you can always go up to the type anyway since that's exactly what the
code does that calls FindConvention does anyway

AutoMapColumn.cs
private bool HasExplicitTypeConvention(PropertyInfo property)
{
var convention = conventions.FindConvention
(property.PropertyType);

}

I know this would be a breaking change but it's very hard to figure
out if the Convention can handle the type unless you end up creating a
very complex AlterMap method and have to merge a bunch of classes
together as opposed to being able to add ones like I did using a
little bit of generics.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[fluent-nhib] Re: Signing our assemblies

2009-01-14 Thread James Gregory
That's a good call.

On Wed, Jan 14, 2009 at 12:07 PM, Luis Abreu  wrote:

>  +1 for signing and adding the allow partial calllers attribute so that
> non-signed dlls can still call use the assembly.
>
>
>
>
>
>
>
> *From:* fluent-nhibernate@googlegroups.com [mailto:
> fluent-nhibern...@googlegroups.com] *On Behalf Of *Andrew Stewart
> *Sent:* terça-feira, 13 de Janeiro de 2009 20:09
> *To:* fluent-nhibernate@googlegroups.com
> *Subject:* [fluent-nhib] Re: Signing our assemblies
>
>
>
> I think signing is a good idea, it just makes playing with other code
> easier, imho.
>
>
>
> Andy
>
> On Tue, Jan 13, 2009 at 7:58 PM, James Gregory 
> wrote:
>
> Nobody seemed to have any opinions on it, so it's been left alone
> currently. The key is still distributed with the project, so you're welcome
> to sign it yourself until we make a decision.
>
>
>
> On Tue, Jan 13, 2009 at 7:55 PM, Ralph Balck  wrote:
>
>
> I dont know if you guys have gone ahead with this or not, but im all
> for signing.
>
>
> On Dec 21 2008, 4:51 pm, "James Gregory" 
> wrote:
>
> > Guys,
> > I'm just combing through the Issues list and one that stood out as a very
> easy
> > fix concerns signing the assemblies. We already have a snk, however I
> > thought I'd ask what everyone thought about it. Should we be signing our
> > assemblies?
> >
> > I'm not really aware of the implications of signing, I realise you need
> it
> > for the GAC, and you can't use unsigned assemblies from within a signed
> one.
> > They all sound like good reasons to sign ours; however, are there any
> > reasons we shouldn't be signing?
> >
> > James
>
>
>
>
>
>
>
>
> --
> =
> I-nnovate Software - Bespoke Software Development, uk wirral.
> http://www.i-nnovate.net
>
>
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[fluent-nhib] Re: Signing our assemblies

2009-01-14 Thread Luis Abreu
+1 for signing and adding the allow partial calllers attribute so that
non-signed dlls can still call use the assembly.

 

 

 

From: fluent-nhibernate@googlegroups.com
[mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Andrew Stewart
Sent: terça-feira, 13 de Janeiro de 2009 20:09
To: fluent-nhibernate@googlegroups.com
Subject: [fluent-nhib] Re: Signing our assemblies

 

I think signing is a good idea, it just makes playing with other code
easier, imho.

 

Andy

On Tue, Jan 13, 2009 at 7:58 PM, James Gregory 
wrote:

Nobody seemed to have any opinions on it, so it's been left alone currently.
The key is still distributed with the project, so you're welcome to sign it
yourself until we make a decision.

 

On Tue, Jan 13, 2009 at 7:55 PM, Ralph Balck  wrote:


I dont know if you guys have gone ahead with this or not, but im all
for signing.


On Dec 21 2008, 4:51 pm, "James Gregory" 
wrote:

> Guys,
> I'm just combing through the Issues list and one that stood out as a very
easy
> fix concerns signing the assemblies. We already have a snk, however I
> thought I'd ask what everyone thought about it. Should we be signing our
> assemblies?
>
> I'm not really aware of the implications of signing, I realise you need it
> for the GAC, and you can't use unsigned assemblies from within a signed
one.
> They all sound like good reasons to sign ours; however, are there any
> reasons we shouldn't be signing?
>
> James

 








-- 
=
I-nnovate Software - Bespoke Software Development, uk wirral.
http://www.i-nnovate.net




--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[fluent-nhib] Re: Undefined Alias or unknwon Mapping

2009-01-14 Thread James Gregory
After the persistenceModel.Configure(cfg) inspect the cfg object, you should
be able to see which classes have been mapped. Is the one you're using in
there?

On Wed, Jan 14, 2009 at 11:05 AM, nformosa  wrote:

>
> Hi All,
>
> I'm starting off with Fluent and its seems, until my first error, that
> its a much better way of implementing nhibernate than using xml
> mappings at least code is something that i can interpret easier than
> xml.
>
> Any way...my first try and i have my first problem. I keep getting the
> following error: "Undefined alias or unkown mapping: *[SELECT * FROM
> NhibernateTest.Entities.Country]
>
> Stake trace:
>
>   at NHibernate.Hql.Classic.PathExpressionParser.Token(String token,
> QueryTranslator q)
>   at NHibernate.Hql.Classic.ParserHelper.Parse(IParser p, String
> text, String seperators, QueryTranslator q)
>   at NHibernate.Hql.Classic.SelectParser.Token(String token,
> QueryTranslator q)
>   at NHibernate.Hql.Classic.ClauseParser.Token(String token,
> QueryTranslator q)
>   at NHibernate.Hql.Classic.ClauseParser.End(QueryTranslator q)
>   at NHibernate.Hql.Classic.PreprocessingParser.End(QueryTranslator
> q)
>   at NHibernate.Hql.Classic.ParserHelper.Parse(IParser p, String
> text, String seperators, QueryTranslator q)
>   at NHibernate.Hql.Classic.QueryTranslator.Compile()
>   at NHibernate.Hql.Classic.QueryTranslator.Compile(IDictionary`2
> replacements, Boolean scalar)
>   at NHibernate.Engine.Query.HQLQueryPlan..ctor(String hql, String
> collectionRole, Boolean shallow, IDictionary`2 enabledFilters,
> ISessionFactoryImplementor factory)
>   at NHibernate.Engine.Query.HQLQueryPlan..ctor(String hql, Boolean
> shallow, IDictionary`2 enabledFilters, ISessionFactoryImplementor
> factory)
>   at NHibernate.Engine.Query.QueryPlanCache.GetHQLQueryPlan(String
> queryString, Boolean shallow, IDictionary`2 enabledFilters)
>   at NHibernate.Impl.AbstractSessionImpl.GetHQLQueryPlan(String
> query, Boolean shallow)
>   at NHibernate.Impl.AbstractSessionImpl.CreateQuery(String
> queryString)
>   at NHibernateTest.DataAccess.Beans.EAO`1.GetAllObjects[T](String
> str) in C:\Documents and Settings\nicholasf\My Documents\Visual Studio
> 2008\Projects\NHibernateTest\NHibernateTest\DataAccess\Beans
> \EAO.cs:line 49
>   at NHiberateTestFrontEnd.Form1.button1_Click(Object sender,
> EventArgs e) in C:\Documents and Settings\nicholasf\My Documents
> \Visual Studio 2008\Projects\NHiberateTestFrontEnd
> \NHiberateTestFrontEnd\Form1.cs:line 27
>   at System.Windows.Forms.Control.OnClick(EventArgs e)
>   at System.Windows.Forms.Button.OnClick(EventArgs e)
>   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
>   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
> button, Int32 clicks)
>   at System.Windows.Forms.Control.WndProc(Message& m)
>   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
>   at System.Windows.Forms.Button.WndProc(Message& m)
>   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage
> (Message& m)
>   at System.Windows.Forms.Control.ControlNativeWindow.WndProc
> (Message& m)
>   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr
> hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
>   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
> msg)
>   at
>
> System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop
> (Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
>   at
> System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner
> (Int32 reason, ApplicationContext context)
>   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop
> (Int32 reason, ApplicationContext context)
>   at System.Windows.Forms.Application.Run(Form mainForm)
>   at NHiberateTestFrontEnd.Program.Main() in C:\Documents and Settings
> \nicholasf\My Documents\Visual Studio 2008\Projects
> \NHiberateTestFrontEnd\NHiberateTestFrontEnd\Program.cs:line 18
>   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[]
> args)
>   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
> assemblySecurity, String[] args)
>   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly
> ()
>   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
>   at System.Threading.ExecutionContext.Run(ExecutionContext
> executionContext, ContextCallback callback, Object state)
>   at System.Threading.ThreadHelper.ThreadStart()
>
>
>
> Is there something i'm missing? the following is my SEssion Manager:
>
>
> private ISessionFactory GetSessionFactory()
>{
>IPersistenceConfigurer persistenceConfigurer =
>MySQLConfiguration
>   .Standard
>   .ConnectionString.Is
> ("Database=HostelWebSystem;Data Source=localhost;User
> Id=root;Password=gandalF13")
>   .ShowSql();
>
>   Configuration cfg =
> persistenceConfigurer.ConfigureProp

[fluent-nhib] Undefined Alias or unknwon Mapping

2009-01-14 Thread nformosa

Hi All,

I'm starting off with Fluent and its seems, until my first error, that
its a much better way of implementing nhibernate than using xml
mappings at least code is something that i can interpret easier than
xml.

Any way...my first try and i have my first problem. I keep getting the
following error: "Undefined alias or unkown mapping: *[SELECT * FROM
NhibernateTest.Entities.Country]

Stake trace:

   at NHibernate.Hql.Classic.PathExpressionParser.Token(String token,
QueryTranslator q)
   at NHibernate.Hql.Classic.ParserHelper.Parse(IParser p, String
text, String seperators, QueryTranslator q)
   at NHibernate.Hql.Classic.SelectParser.Token(String token,
QueryTranslator q)
   at NHibernate.Hql.Classic.ClauseParser.Token(String token,
QueryTranslator q)
   at NHibernate.Hql.Classic.ClauseParser.End(QueryTranslator q)
   at NHibernate.Hql.Classic.PreprocessingParser.End(QueryTranslator
q)
   at NHibernate.Hql.Classic.ParserHelper.Parse(IParser p, String
text, String seperators, QueryTranslator q)
   at NHibernate.Hql.Classic.QueryTranslator.Compile()
   at NHibernate.Hql.Classic.QueryTranslator.Compile(IDictionary`2
replacements, Boolean scalar)
   at NHibernate.Engine.Query.HQLQueryPlan..ctor(String hql, String
collectionRole, Boolean shallow, IDictionary`2 enabledFilters,
ISessionFactoryImplementor factory)
   at NHibernate.Engine.Query.HQLQueryPlan..ctor(String hql, Boolean
shallow, IDictionary`2 enabledFilters, ISessionFactoryImplementor
factory)
   at NHibernate.Engine.Query.QueryPlanCache.GetHQLQueryPlan(String
queryString, Boolean shallow, IDictionary`2 enabledFilters)
   at NHibernate.Impl.AbstractSessionImpl.GetHQLQueryPlan(String
query, Boolean shallow)
   at NHibernate.Impl.AbstractSessionImpl.CreateQuery(String
queryString)
   at NHibernateTest.DataAccess.Beans.EAO`1.GetAllObjects[T](String
str) in C:\Documents and Settings\nicholasf\My Documents\Visual Studio
2008\Projects\NHibernateTest\NHibernateTest\DataAccess\Beans
\EAO.cs:line 49
   at NHiberateTestFrontEnd.Form1.button1_Click(Object sender,
EventArgs e) in C:\Documents and Settings\nicholasf\My Documents
\Visual Studio 2008\Projects\NHiberateTestFrontEnd
\NHiberateTestFrontEnd\Form1.cs:line 27
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage
(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc
(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
   at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop
(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner
(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop
(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at NHiberateTestFrontEnd.Program.Main() in C:\Documents and Settings
\nicholasf\My Documents\Visual Studio 2008\Projects
\NHiberateTestFrontEnd\NHiberateTestFrontEnd\Program.cs:line 18
   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[]
args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly
()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()



Is there something i'm missing? the following is my SEssion Manager:


private ISessionFactory GetSessionFactory()
{
IPersistenceConfigurer persistenceConfigurer =
MySQLConfiguration
   .Standard
   .ConnectionString.Is
("Database=HostelWebSystem;Data Source=localhost;User
Id=root;Password=gandalF13")
   .ShowSql();

   Configuration cfg =
persistenceConfigurer.ConfigureProperties(new Configuration());

   var persistenceModel = new PersistenceModel();
   persistenceModel.addMappingsFromAssembly(Assembly.Load
(_mappingAssembly));
   persistenceModel.Configure(cfg);

   return cfg.BuildSessionFactory();
}


Thanks for your help

Regrds
Nick F


--~--~-~--~~~-