The following is a simplification of my problem domain. We have a series of Trades, that each gets a record in Valuations every business day.
We filter our Valuations List used for a specific day, but to populate the Trade against each of the Valuation rows, NHibernate fires single row selects on the Trades table for around 50k rows in ...
Hello, I'm having a problem mapping a column in table A to a property of a class, which is primarily mapped to table B. The following explains this better:
There's a class CustomerRisk, which has properties Risk and CustomerNumber.
In the database, this consists of two tables: Customer, which has a column CustomerNumber, and CustomerRi...
I'm using latest Fluent NHibernate lib (0.1.0.452) and I have a problem with saving child entitites.
I think this is rather common scenario... I've got a parent with mapping:
HasMany<Packet>(x => x.Packets)
.Cascade.All()
.KeyColumnNames.Add("OrderId");
and a simple Packet class that (in a domain model and FNH...
Hi,
I've been racking my head trying to get Nhibernate to work with a byte
array as version mapping to an sql timestamp. I'd implemented an
IUserVersionType but Nhibernate was creating varbinary in the database
rather than timestamp. Inspired by a blog post by Ayende recently on
concurrency, I changed my mapping to specify the sql-type t...
How can I map this:
public class Customer
{
private IList<Order> _orders;
public IEnumerable<Order>
GetAllOrders()
{
return _orders;
}
}
On the project page are some samples but none is about this situation.
There is this sample:
// model
public class Account
{
private IList<Customer> customers =...
I am building a WPF application using the MVVM pattern. Our stack looks like this:
SQL Server 2008 -> Entity Framework
We use StructureMap for dependency injection to inject our DataFactory which essentially does the CRUD for our POCO business objects.
The ViewModels use the DataFactory for CRUD and the xaml is data bound to the prop...
I just want to do a quick poll to see if Fluent Nhibernate is well received or if it is having lot of issues. I like Nhibernate but I definitely see the problem with xml to do mapping.
So, I am looking forward to community members for some insight and help me pick one over the other.
I am not considering either linq2sql or entity fram...
I have a Fluent Nhibernate map like :
public class UserMap : ClassMap<PortalUser>
{
public UserMap()
{
WithTable("aspnet_Users");
Id(x => x.Id, "UserId")
.GeneratedBy.Guid();
Map(x => x.Name, "UserName");
Map(x => x.Login, "LoweredUserName");
WithTable("LdapUsers", m => m.Map(...
Hi All,
I have a simple scenario where I have an entity Action (this is a workflow style application) that has a DueDate calculated property.
Now id like to introduce a SlidingAction, whose only difference (at this stage) is to override the DueDate calculation, as such has none of its own mapping.
Im having difficulty mapping this sce...
In Fluent NHibernate, References() returns an object which doesn't support the 'ReadOnly()' method.
I'm trying to create this sort of mapping (i.e. one where an update is not propagated to the referred item):
<many-to-one update="false" insert="false"
name="DestinationSheet" column="DestinationSheetNumber" />
On normal (map()) mappi...
In this question I was answered hot to map a composed entity from the primary key of the table.
So given:
public UserMap()
{
WithTable("aspnet_Users");
Id(x => x.Id, "UserId")
.GeneratedBy.Guid();
Map(x => x.Name, "UserName");
Map(x => x.Login, "LoweredUserName");
WithTable("LdapUsers", m => {
m.Map...
I like the pattern I saw in this blog post (http://marekblotny.blogspot.com/2009/04/conventions-after-rewrite.html), where the author is checking to see if a table name alteration has already been made before applying a convention.
public bool Accept(IClassMap target)
{
//apply this convention if table wasn't specified with WithTabl...
Hello All
I'd like to have an 'UnassignedDepartment' object instead of letting employees have a null Department:
public class UnassignedDepartment : Department
{
public UnassignedDepartment() : base("not yet assigned") {
Id = -99; <-- just some Id that can be held constant, not be generated..
}
}
This is accessible by...
Hi,
I am using fluent nhibernate.
I have written a piece of code like,
var data = session.CreateCriteria(typeof(CustomerNameValueList))
.Add(Expression.Eq("CustomerId","3"))
.List<CustomerNameValueList>();
but the query generated by nhibernate is looks like
select column1,column2,colu...
Given a Vehicle class and a VehicleProperty class...
public class Vehicle
{
public virtual int Id { get; protected set; }
public virtual string Registration { get; set; }
private List<VehicleProperty> _properties = new List<VehicleProperty>();
public virtual IEnumerable<VehicleProperty> Properties
{
get { re...
I am working on a new application that uses a jet (MS Access) database. I have built the database using FluentNHibernate's AutoMapping feature from my C# objects.
I need to present this database for an on-line WebEx design review on Tuesday and am looking for a tool to create ERD's for my database that I can group onto slides.
The dia...
Essentially the title of this question explains the essense of what I am trying to do, but to create a contrived example...
I have a class, call it Employee. Employee has an IPaymentBehaviour...
public class Employee
{
IPaymentBehaviour _paymentBehaviour;
protected internal Employee() { /* required by NH */}
public Employee(IP...
I am trying to create a mapping to a database table that has no primary keys/references.
public class TestMap : ClassMap<Test> {
public TestMap() {
WithTable("TestTable");
Map(x => x.TestColumn);
}
}
This fails and expects id or composite-id. Is this possible in fluent nhibernate?
...
I have just started a new project using nHibernate and Fluent for mapping. The architect has sent me a database from which I have generated several hundred entity classes and the corresponding Fluent mapping files. I know this is not the ideal DDD way of doing things but life is rarely ideal.
What I want to do is test that all the mappi...
I'm using Fluent NHibernate in order to auto map my entities.
This is the code I'm using for the auto mapping:
new AutoPersistenceModel()
.AddEntityAssembly(Assembly.GetAssembly(typeof(Entity)))
.Where(type => type.Namespace.Contains("Domain") && type.BaseType != null && type.BaseType.Name.StartsWith("DomainEntity") && type.BaseTyp...