I just recently started using Fluent NHibernate and have to say that
it is a fantastic help. Recently we ran into a small issue that I
can't seem to find an obvious way around. Obvious to me, I should
say. :)
We use this class as a base type so that the Id and a couple of other
fields will be
What about support auxiliary database objects?
This official nhibernate documentation: 5.6
http://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html/mapping.html
I want to use some server's views in my application.
I have the immutable classes mapping for this views, and I have create
You can't currently. Either use hbm.xml or traditional sql.
On Sat, Mar 14, 2009 at 3:30 PM, Rub ruboard@gmail.com wrote:
What about support auxiliary database objects?
This official nhibernate documentation: 5.6
I am playing with the latest conventions code and loving it so far.
But when I tried to implement a convention for my column names to
match what my Oracle DBA tells me I must do, I run into trouble.
When I declare the following:
public class ColumnNameConvention : IPropertyConvention
{
How recently did you update?
Properties can have multiple columns and it was ambiguous whether you were
setting the name or adding an extra one, I've since updated the code to make
it a bit clearer. If I remember correctly your Apply should contain:
target.ColumnNames.Clear(); // make sure there
How can I work with fluent nhibernate class maps and hbm (embedded
resource files) together in FH?
On 14 мар, 21:02, James Gregory jagregory@gmail.com wrote:
You can't currently. Either use hbm.xml or traditional sql.
On Sat, Mar 14, 2009 at 3:30 PM, Rub ruboard@gmail.com wrote:
I figured out what caused it, but I am still stuck
Some of my properties happens to be reserved words in the database. So
in my ClassMap, I explicitely declare them like this:
Map(x = x.Column)
.ColumnName(COLUMN_NAME);
I need to be able to explicitly call ColumnName in my ClassMaps
I forget the number, but it was from yesterday. I will try to rewrite
considering what you just posted. (our posts crossed)
On Mar 14, 9:16 am, James Gregory jagregory@gmail.com wrote:
How recently did you update?
Properties can have multiple columns and it was ambiguous whether you were
I got it working, but the code does not feel right. The code in my
Apply method is what really bugs me.
In my class map, I now need to do the following..
Map(x = x.Column, COLUMN_NAME)
And in my IPropertyConvention I need to do this
public void Apply(IProperty target)
In our development we are frequently using readonly properties backed
with private fields.
Is there any way to automap such case?
From my walking through code this is impossible to create custom
convention just because:
public virtual void mapEverythingInClassT
Read the wiki: http://wiki.fluentnhibernate.org/show/FluentConfiguration
2009/3/14 Rub ruboard@gmail.com
How can I work with fluent nhibernate class maps and hbm (embedded
resource files) together in FH?
On 14 мар, 21:02, James Gregory jagregory@gmail.com wrote:
You can't
You need to use Access.AsField() to inform FNH that the readonly property is
backed by a field.
On Sat, Mar 14, 2009 at 4:48 PM, Mike Chaliy m...@chaliy.name wrote:
In our development we are frequently using readonly properties backed
with private fields.
Is there any way to automap such
Thanks. That tidbit will proove useful. But I still think that
there should be a clean way of making the IPropertyConvention only
apply if I've not already explicitly specified a column name.
On Mar 14, 9:58 am, James Gregory jagregory@gmail.com wrote:
If your column names are sometimes
What's wrong with this:
public bool Accept(IProperty target)
{
return (target.ColumnNames.List().Count == 0);
}
On Sat, Mar 14, 2009 at 5:15 PM, JohnRudolfLewis johnrle...@gmail.comwrote:
Thanks. That tidbit will proove useful. But I still think that
there should be a clean way of
Duh... Thanks.
On Mar 14, 10:17 am, James Gregory jagregory@gmail.com wrote:
What's wrong with this:
public bool Accept(IProperty target)
{
return (target.ColumnNames.List().Count == 0);
}
On Sat, Mar 14, 2009 at 5:15 PM, JohnRudolfLewis johnrle...@gmail.comwrote:
Thanks.
No problem :)
On Sat, Mar 14, 2009 at 5:32 PM, JohnRudolfLewis johnrle...@gmail.comwrote:
Duh... Thanks.
On Mar 14, 10:17 am, James Gregory jagregory@gmail.com wrote:
What's wrong with this:
public bool Accept(IProperty target)
{
return (target.ColumnNames.List().Count == 0);
How can I get NHibernate.Configuration object from Fluently object?
I use my multi factory configuration provider and I don't want
BuildSessionFactory(), simple, I just need NHibernate.Configuration.
On 14 мар, 21:55, James Gregory jagregory@gmail.com wrote:
Read the
Hey,
Not sure what you mean by this. As far as I can tell, Reveal doesn't
work on fields. I get the same error as Anders. I tried adding
Access.AsField() for the heck of it as well and it still threw a
FluentNHibernate.UnknownPropertyException.
So, is this a bug? It seems to me Reveal should
What would you suggest?
On Fri, Mar 13, 2009 at 10:44 PM, Blee le...@abl-consulting.com wrote:
I just recently started using Fluent NHibernate and have to say that
it is a fantastic help. Recently we ran into a small issue that I
can't seem to find an obvious way around. Obvious to me, I
You can either pass an existing instance into the Fluently.Configure method,
or you can use BuildConfiguration.
2009/3/14 Rub ruboard@gmail.com
How can I get NHibernate.Configuration object from Fluently object?
I use my multi factory configuration provider and I don't want
The key to what paul said is private auto properties. Use an autoproperty,
not a field.
private string PasswordHash { get; set; }
instead of
private string PasswordHash;
On Sat, Mar 14, 2009 at 5:59 PM, Nick Gieschen nickgiesc...@gmail.comwrote:
Hey,
Not sure what you mean by this. As far
I was hoping that I was simply missing how to do this. Ideally, what
I would like to be able to ignore a property off of a base class
instead of having to ignore that property on each child class.
Unfortunately, at the moment, I get an invalid cast trying to
AutoMapBaseClass to AutoMapSubClass.
I haven't tried what I'm about to propose, but I think it would work.
1) Create an attribute that you will put on the properties that you
want to ignore (for example, an [Ignore] attribute)
2) Override the IPropertyConvention (see here:
http://wiki.fluentnhibernate.org/show/Conventions). In the
Please re-read my previous email. you can use BuildConfiguration, that
method will do what you ask. If you don't have that method, you need to get
the latest source.
2009/3/14 Rub ruboard@gmail.com
I don't want to pass my instance to Fluently. I want to get
NHibernate.Configuration from
Using a property convention, I am able to apply a particular property
convention to that property (rename tables, fields, etc) but I don't
see a way to ignore it. If there is, this approach would be ideal.
On Mar 14, 3:26 pm, Jon Kruger krugs...@gmail.com wrote:
I haven't tried what I'm about
You should be able to do this with a convention:
public class AccessAsFieldConvention : IPropertyConvention
{
public bool Accept(IProperty target)
{
return true; // or filter on target.EntityType for just specific
entities
}
public void Apply(IProperty target)
{
This is will work only if you have property... I have an
public Comment[] Comments {{get..}}
And seems that Fluent-NHibernate does not treat this as property.
Fortunately I can switch to IEnumerable, as far I know this will work.
Thank you very much for your support!
BTW what is you preferred
This is will work only if you have property... I have an
public Comment[] Comments {{get..}}
It's helpful to know that kind of thing before I spend time fixing things.
I've just committed another set of changes that expose the Access property
to the other conventions; so now you can
Thank you very much, I will try new version tomorrow.
On Mar 15, 1:08 am, James Gregory jagregory@gmail.com wrote:
This is will work only if you have property... I have an
public Comment[] Comments {{get..}}
It's helpful to know that kind of thing before I spend time fixing things.
Consider it fixed. There's now a NotFound property on HasMany and
HasManyToMany.
On Sat, Mar 14, 2009 at 6:57 PM, Adam Dymitruk adymit...@gmail.com wrote:
Would a temporary work-around using views help?
On Thu, Mar 12, 2009 at 8:19 AM, Andrew Burns erebus...@gmail.com wrote:
I also asked
What's the purpose of the Accept() method then if it's not to ignore certain
properties?
On Sat, Mar 14, 2009 at 7:00 PM, James Gregory jagregory@gmail.comwrote:
Although the idea is sound, it unfortunately won't work as there's no way
to ignore properties through conventions. Definitely
Automapping is a different game entirely. The Accept method is used to
ignore properties when applying conventions. The automapper has an explicit
IgnoreProperty that's used to actually not map the property at all, which is
completely different.
On Sun, Mar 15, 2009 at 1:27 AM, Jon Kruger
32 matches
Mail list logo