OK, so here is the problem. Its not even as crazy as the guy who wants to map m:n with different column counts in his PKs.
No matter what I do or where I look there seems to be no method chain that will result in a successful mapping of this.
I have tried doubling up on the Parent and Child columns, eg ParentColumn("").ParentColumn(""...
I am using log4Net in my application which also uses nHibernate. Now my eventlogger is flooded with nHibernate messages which I want to suppress.
I have tried this but it did not work.
<log4net>
<appender name="EventLogAppender" type="log4net.Appender.EventLogAppender">
<param name="LogName" value="App Log" />
<param n...
I am getting a cannot load entity error because of {"Incorrect syntax near the keyword 'File'."}
Here is my mapping file. I'm assuming I am not escaping something properly but I don't see what. I don't think it's my PreApplication.File table name. Thanks in advance!!
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="...
The problem:
A DBA-controlled database with a Stored Procedure-only mandate.
An expectation that the domain be defined in POCO's.
So I decided that I need an ORM designed for stored procedures and/or legacy databases.
Ideally the ORM should allow me to declaratively (or fluently) map domain objects to CRUD stored procedures.
Some f...
I'm working on a RoleProvider in .NET, using Fluent NHibernate to map tables in an Oracle 9.2 database.
The problem is that the many-to-many table connecting users and roles uses a primary key generated from a sequence, as opposed to a composite key. I can't really change this, because I'm writing it to be implemented in a larger exist...
I've got a deadline for an initial release of a client-server application that will have lots of iterative releases subsequently.
NHibernate is the ORM of choice, largely by reputation and my desire to gain experience with it.
The problem is that I haven't even had a chance to spike NHibernate yet, and I'm afraid that doing so is going...
Are you ever succeed input NHibernate logging using CodeCampServer architecture?
I read this and I did everything that I can. Maybe there is know problem in this architecture.
I using Infrastructure.NHibernate.DataAccess.Bases.Logger.EnsureInitialized();
to initialize log4net. here the code:
public class DependencyRegistrar
{
pri...
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; }...
Current code in my convention:
public void Apply(FluentNHibernate.Conventions.Instances.IVersionInstance instance)
{
instance.Column("RowVersion");
instance.Not.Nullable();
instance.UnsavedValue("0");
instance.Default(1);
}
This doesn't render the RowVersion as a version column. It treats Ro...
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.
...
Hi All,
We have been suggested to use NHibernate for our project. But the point is our application will only be retrieving the data from the database so are there any benefits of using NHibernate in this scenario?
One more thing, what is the query execution plan in NHIbernate does it support something like prepared statements or the so...
Hi,
Is reading the database records from the Database using Stored Procedures in NHibernate a good approach?If yes then why or if No, then also why?
The application has only the feature of reading values from the database using NHibernate in the data access layer no updates and no inserts just only retrieval.
...
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...
Hi,
I'm attempting to use NHibernate.Linq to return objects deep from my object graph, and for some reason NHibernate is returning the root object. I don't know if I'm missing something, or if it is just a problem with NHibernate.Linq.
The compiler correctly infers that I am trying to return an object of type FacilityInstruction when ...
I'm about to switch some of my entities from identity to hilo id-generator.
I'm don't have a clue how the tables holding the next-high values should be designed.
should I use a single table for all entities, or for a group of related entities?
should I use another table for each entity?
should I use a single table with another row or ...
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...
Hi,
In my current project, Workflows have comments. Please have a look at the following code.
[CompositeId]
[KeyProperty(1, Column = "datum", Name = "Date", TypeType = typeof(DateTime))]
[KeyManyToOne(1, Column = "workflow_id", Name = "Workflow", ClassType = typeof(Workflow))]
public virtual IWorkflow Workflow { get; set; }
...
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?
...