Hello,
I am getting the following error when trying to update an object in a db. Does anyone have any idea what might be happening? I have checked all my datatypes and they correspond to what is in the db. Thanks for any thoughts -
NHibernate.HibernateException was unhandled by user code
Message="identifier of an instance of DataT...
In .hbm.xml the mapping I am after would look as follows - any idea how I can reproduce this in Fluent NHibernate...?
<class name="Dinosaur" table="Dinosaur" >
<composite-id>
<key-property name="Id" column="Id"/>
<key-property name="Period" column="Period"/>
</composite-id>
<property name="DinosaurType" c...
Our client wants to support both SQL Server and Oracle in the next project. Our experience comes from .NET/SQL Server platform. We will hire an Oracle developer, but our concern is with the DataAccess code. Will NHibernate make the DB Engine transparent for us? I don't think so, but i would like to hear from developers who have faced si...
I have a WPF Application using Fluent NHibernate 1.0 RTM and System.Data.SQLite 1.0.65 that works fine in .Net 3.5. When I try to upgrade it to .Net 4.0 everything compiles but I get a runtime error where the innermost exception is this:
`The IDbCommand and IDbConnection implementation in the assembly System.Data.SQLite could not be fou...
Suppose, I have saved some permissions in the database by using this code:
RoleRepository roleRep = new RoleRepository();
Role role = new Role();
role.PermissionItems = Permission.GetList();
roleRep .SaveOrUpdate(role);
Now, I need this code to delete the PermissionItem(s) associated with a Role when role.PermissionItems == null.
Her...
Is there any architecture or framework for Desktop applications similar to S#arp architecture for Web applications. S#arp Architecture uses Fluent NHibernate.
...
I want to start working on a big project. I research about performance issues about LINQ to EF and NHibernate. I want to use one of them as ORM in my project. now my question is that which one of these two ORM can get me better performance in my project? I will use SQL Server 2008 as database and C# as programming language.
...
I'm tring to get my product's types to a list with Linq.
var types = (from t in NHibernateSession.Linq<Product>()
select t.ProductType).Distinct().ToList<ProductType>();
return types;
But its giving an Unable to cast object of type error
'...Domain.Product' to type '...Domain.ProductType'.
ProductType is a pro...
Good morning, guys.
I'm with a problem with the query that NHibernate generates. My mapping is like bellow:
public class Matricula
{
[BelongsTo("IdTurma", NotNull=True)]
public Turma {get;set;}
}
public class Turma
{
[BelongsTo("IdCurso", NotNull=True)]
public Curso {get;set;}
}
public class Curso
{
...
I have a workflow class that has a collection of phases, each phase has a collection of tasks. You can design a workflow that will be used by many engagements. When used in engagement I want to be able to add properties to each class (workflow, phase, and task). For example a task in the designer does not have people assigned, but a ta...
Hello,
I am inserting a record into my table, but I want to be able to set my
SortOrder field on insert to SELECT MAX(SortOrder) + 1 FROM Category
WHERE SiteID = @SiteID. What is the easiest way of doing this?
Here is my data structure:
Category
ID
SiteID
SortOrder
Name
I am using Fluent NHibernate and Linq to NHibernate. Thanks...
I've been reading up on MVC 2 and the recommended patterns, so far I've come to the conclusion (amongst much hair pulling and total confusion) that:
Model - Is just a basic data container
Repository - Provides data access
Service - Provides business logic and acts as an API to the Controller
The Controller talks to the Service, the S...
Is it possible to eagerly load polymorphic association using Linq and NH?
For example: Company is base class, Department is inherited from Company, and Company has association Employees to the User (one-to-many) and also association to the Country (many-to-one).
Here is mapping part related to inherited class (without User and Country c...
Hi all
I have a mapping file
<set name="Friends" table="Friends">
<key column="UserId"/>
<many-to-many class="User" column="FriendId"/>
</set>
I would like to specify extra columns for the friend table this creates.
For example Approve (the user must approve the friend request)
Is there a easy way?
And update
<?xml v...
We have audit columns set by triggers.
For obscure security reasons predating my tenure and out of my control, we log in with a generic user, and do a 'set session authorization' to change the user to the db user of the user who is logged in.
When we converted to NHibernate, it creates a whole new session and jacks everything up
when we...
I have some classes in my app that don't require an ID to be persisted. These could be things like user logs or audit records. I can add an arbitaty id to them but I would like to avoid that as they don't mean anything.
The retrieval of these objects is always on another key (like UserId) which is not unique to the record.
...
plz help me i need a sample application
thanks
...
In NHibernate, what is the difference between ManagedWebSessionContext and WebSessionContext ? Which is best to use, and why ?
Based on the description found here, I cannot tell the difference.
...
The following code can be found in the NHibernate.Id.GuidCombGenerator class. The algorithm creates sequential (comb) guids based on combining a "random" guid with a DateTime. I have a couple of questions related to the lines that I have marked with *1) and *2) below:
private Guid GenerateComb()
{
byte[] guidArray = Guid.NewGuid().T...
Hi,
I am in the process or learning NHibernate so bare with me.
I have an Order class and a Transaction class. Order has a one to many association with transaction. The transaction table in my database has a not null constraint on the OrderId foreign key.
Order class:
public class Order {
public virtual Guid Id { get; set; }...