Hi!
I´m receiving a very strange error with NHibernate 2.1.2.4000 GA and latest version of FluentNHibernate. I can save an entity but can´t load it back after a call to Flush() and Clear().
This is my entity:
public class Application
{
public int Id { get; set; }
public string Name { get; set; }
public string KeyName { get; set; }...
Hi,
I'm observing some strange behavior whilst trying to perform a query on an NHibernate entity. The primary key of my object is a string (guid), but when I pass in the guid string I wish to query by, I get an exception,
NHibernate.ADOException: could not execute query System.FormatException: Input string '6eaa591f-bb75-4c0b-8acb-...
would like to set this convention up globally if possible.
...
I have table CUSTOMER where CUSTOMER_ID is primary key.
Table
CREATE TABLE [CUSTOMER](
[CUSTOMER_ID] [int] NOT NULL,
[START_DATE] [varchar(30)] NOT NULL,
CONSTRAINT [PK_CUSTOMER] PRIMARY KEY CLUSTERED ( [CUSTOMER_ID] ASC .....
Mapping
public class CustomerMap : ClassMap<Customer> {
public CustomerMap()
{
With...
Given this (HORRIBLE) object graph that I can't change
public class Email
{
public Email(string email) { ... }
//DO a bunch of worthless stuff
}
public interface IPerson
{
Email Email{get;set;}
}
Does something like this exist?
Map(p => p.EmailAddress).Use(s => new EmailAddress(s));
Essentially the Person interface won...
I have the following tables and cannot edit their structure...
Person
------
Id PK
Code
Name
Order
-----
Id PK
Person_Code
OrderDetails
Now in my Person class I want to have a list of Orders for that person, but I'm not entirely sure how to go about setting up the mapping in fluent nhibernate to match on the Code column rather than t...
I want to set up the access strategy so that if a field.camelcase-underscore property backing is present then use that else use the automatic property.
is this the default behavior (since auto props have back fields essentially)? or how to I enforce this?
...
If I have the following existing table schema
+-------------------+ +-------------------+
| Address | | Country |
+-------------------+ +-------------------+
| Line1 | +--->| CountryId |
| Line2 | | | Name |
| City | | +-------...
Hi,
Im trying to map the following classes:
public abstract class ScheduleType
{
public virtual int Id { get; set; }
public virtual TypeDiscriminatorEnum Discriminator { get; set; }
}
public class DerivedScheduleType : ScehduleType
{
public virtual bool MyProperty { get; set; }
}
public class ScheduleTypeMap : ClassMap...
I've found a number of posts about this but none seem to help me directly. Also there seems to be confusion about solutions working or not working during different stages of FluentNHibernate's development.
I have the following classes:
public class MappedClass
{
...
}
public enum MyEnum
{
One,
Two
}
public class Foo
{
...
I just read this article about the Entity Framework 4 (actually version 2).
Entity Framework seems to offer a huge improvement over its first release. Thus, I have never ever used EF in any project, since I think EF is not mature enough in comparison to NHibernate.
NHibernate and its current contributions of FluentNHibernate and Linq f...
I'm a C# programmer constrained to write VB.NET code.
While exploring NHibernate further for my current client, I encountered FluentNHibernate, which I find real attractive.
But now, I wonder how to "translate" this C# code for component mapping into VB.NET code:
Component(x => x.Address, m =>
{
m.Map(x => x.Number);
m.Map(x =...
How-tu use NHibernate (with Fluent NHibernate) with SQL Server Full Text Search ?
Thanks
...
Edit: changed class names.
I'm using Fluent NHibernate (v 1.0.0.614) automapping on the following set of classes (where Entity is the base class provided in the S#arp Architecture framework):
public class Car : Entity
{
public virtual int ModelYear { get; set; }
public virtual Company Manufacturer { get; set; }
}
public class ...
I have this mapping:
public sealed class EntityMap : ClassMap<Entity>
{
public EntityMap ()
{
...
Component(entity => entity.StateHistory,
m => m.HasMany<HistoryItem<EntityState>>
(Reveal.Property<EntityStateHistory>("Items"))
.Table("EntityStateHistory")
...
This would be a great feature - to dress my Domain objects with class and property attributes, such as
[Description("The 'Cat' entity holds information about Cats")]
public class Cat
{
[Description("The Cat.Name property holds the real name of the Cat such as 'Fluffy'")]
public virtual string Name { get; set; ...
Hi
I have an object that contains a collection of TimeSpan like
Note.Reminders, where reminders is List. How to I map this using fluent nhibernate?
Currently I have mapped it as m.HasMany(c=>c.Reminders).Access.CamelCaseField()
But i complains that it can not find a mapping for type TimeSpan.
...
I have an entity called Books that can have a list of more books called RelatedBooks.
The abbreviated Book entity looks something likes this:
public class Book
{
public virtual long Id { get; private set; }
public virtual IList<Book> RelatedBooks { get; set; }
}
Here is what the mapping looks like for this relationship
...
I have a little problem with fluentNhibernate and MySQL.
I would like to map my entity:
public class Topic
{
public Topic()
{
ParentTopic = null;
}
public virtual Guid Id { get; set; }
public virtual string Name { get; set; }
public virtual DateTime CreatedAt { get; private set; }
public virtual Gui...
Hi,
can someone tell me how to use nhibernate serach and lucene with fluent nhibernate. I have my application writen with fluent nhibernate but now i need full text serach but do not know how to implmenet nhibernate search with lucene to fluent nhibernate.
i found this but it is not much and do not know how to use it:
http://stackoverf...