-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
I have two objects with a many-to-many relationship between them, as follows:
public class LeftHandSide
{
public LeftHandSide()
{
Name = String.Empty;
Rights = new HashSet<RightHandSide>();
}
public int Id { get; set; }
public string Name { get; set;…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hello there,
I am trying to use NHibernate with Spring.Net und mySQL 5. However, when setting up the connection and creating the SessionFactoryObject, I get this InvalidCastException:
NHibernate seems to cast MySql.Data.MySqlClient.MySqlConnection to System.Data.Common.DbConnection which causes…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
One of practices advocated by Nhibernate experts is to do all actions in inside a transaction.
In a typical 3 tier web architecture, Nhibernate depedency is limited the data layer.
In such a case is it fine to use
using (var tr = NHibernateSession.Current.BeginTransaction()) {
at the controller…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hello, and first off thanks for your time to look at this.
For a research project I'm working on, I have a somewhat complex design (which I've been given) to persist to a database via NHibernate.
Here's an example of the class hierarchy:
TransitStrategy, TransportationCompany and TransportationLocation…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hello, I have a table with a time column in my SQL Server 2008 database.
The property of the object I'm trying to map to is a TimeSpan.
How can i tell FluentNHibernate to use the TimeAsTimeSpan NHibernate type, so that I don't have cast problems?
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Currently I'm using Fluent NHibernate to generate my database schema, but I want the entities in a HasMany relationship to point to a different column for the reference. IE, this is what NHibernate will generate in the creation DDL:
alter table `Pony` add index (Stable_ID),
add constraint Ponies_Stable…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I am trying to figure out what I thought was just a simple one to many mapping using fluent Nhibernate. I hoping someone can point me to the right directory to achieve this one to many relations
I have an articles table and a categories table
Many Articles can only belong to one Category
Now my Categores…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I want to learn to use Fluent NHibernate, and I'm working in VS2010 Beta2, compiling against .NET 4, but I'm experiencing some problems.
Summary
My main problem (at the moment) is that the namespace FluentNHibernate isn't available even though I've imported all the .dll assemblies mentioned in this…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
We have a project using FluentNibernate to map the entities. Now I need to add some format validation to these maps. For Nullable, Length and such we are currently using the mappings. I added NHibernate Validator to the project, but received a compile time error about needing NHibernate version…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hello,
with fluent nhibernate, is there a way to dynamically switch the table of a mapping at runtime?
For example:
public class XYClassMap : ClassMap<XY>
{
public XYClassMap( )
{
Table("XYTable");
Id(d => d.Id).GeneratedBy.Identity();
Map(d => d.Value);
(...)
Given…
>>> More