Hey Guys I would very much appreciate some help with the following. We're using fluent to control the mappings for nhibernate and its all gone well so far. We've basically got a scheduled based CMS system and I'm having problems using the HasMany mapping to exclude the non-live child categories.
So we have the following Data Tables, s...
I have the following database tables:
TABLE dbo.Client
(
ClientId PK uniqueidentifier ,
ClientNames VARCHAR(200)
)
TABLE dbo.User
(
userID PK UniqueIdentifier,
password varchar(15),
passwordsalt varchar(15),
ClientID FK uniqueidentifier
)
I want to map them to my class:
public class Client
{
public virtual Guid Id {...
How can a domain object include a property that calculates a value from other database mapped properties so that the calculated property can be used in both the domain object instance and the db level by nhibernate.linq.
I would like to be able to use the property when working with the object directly:
Console.WriteLine(Entity.Calculat...
I do the following:
var @case = new Case
{
Name = "test"
};
// User is persistent and loaded in the same session
User.AddCase(@case); // sets @case.User = User too
Session.Update(User);
response.CaseId = @case.Id;
The cascade on User.Cases is set to All. But @case.Id is not set until the transacti...
Under one UnitOfWork (session) I may call CreateCriteria twice. My first call is to populate a grid for data editing. Let's say the data has been edited and flushed (saved) to the database and the grid is still open. After the data is edited, I may call CreateCriteria a second time to retrieve a list of objects that are validated and fou...
Hi I have a web application with nhibernate talking to the database.
The application is running very slow due to lot of chatty db calls that nhibernate is doing.
I want to run a profiler or something similar that can give some stats example
number of db trips.
table names and times accessed.
I saw one of the products called nhprof ...
Let's say that I have a class/table called Images that, as it stands right now, is bound in a manner similar to this:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Domain.Image, Domain" table="Images">
<id name="id" column="ImageID" access="field" unsaved-value="0">
<generator class="identity" />
</...
NHibernate has an attribute on the property element in the mapping config named "formula" that allows the injections of sql to "calculate" a property. The issue I have is the formula using sql syntax directly. Is there a way to have nhibernate.linq to use a lambda expression instead of using the formula property.
I have the following:
...
HI all,
What all other libraries or frameworks we can use apart from NHIbernate?
Can linq work with entites as the NHIbernate does?
Can linq automatically generates entities for us?
Does the Data application block come with .NET 3.5 or some separate installation is required?
...
I want to use NHibernate.Spatial. I also want to use new NHibernate 3.0 features such as the improved LINQ provider and the QueryOver functionality, which are only available in NHibernate's source control trunk.
Are these two things compatible? I can't work without Spatial but I really want the LINQ features, which will have to go if th...
Hi i'm looking for some books about asp.net and nhibernate.
Any suggest?
thanks
...
What are the major differences between Data Access Application Block, NHibernate, ADO.NET Entity Framework and LINQ to SQL with respect to performance, business logic, scalability and flexibility?
...
How does NHibernate provide out of the box features as compared to the other OR/M tools available like ADO.NET entity framework and LINQ to SQL?
...
Hi,
I'm using Fluent NHibernate and have two tables;
Customer [ID, Name, LanguageID]
Languages [ID, Description]
I have a Customer entity with the following properties;
ID, Name, LanguageID, Language
What I would like to do is to join to the Languages table to get the language description and put it in the language property of the c...
I am trying to setup a many-to-many mapping in Fluent Nhibernate that has a where clause attached to the child table.
This is basically how it should work:
HasManyToMany(p => p.Images)
.Table("ProductImages")
.ParentKeyColumn("ProductID")
.ChildKeyColumn("ImageID")
.Where("ImageTypeID = 2");
The ImageTypeID column is in the I...
I have a class (Person) that contains an int property (Foo). Another class (FooRange) contains records representing possible ranges of Foo, with high and low boundaries in each row. Think of Foo as a 1 - 100 number and FooRange containing 10 rows, each representing a decile (0-9,10-19,etc.).
How do I structure my NHibernate relationship...
Hi, I have inhertited an legacy application, that I have little control over. I need to map a one to one relationship because "A user may have one of these, lets call them 'a Rejection', but not more than one" The data stored in the Rejection table is quite large.
Anyway, I have simplyfied this model, using cats, dogs and an owner. An ...
Hi, I have strange problem with my NHibernate configuration.
I have .mdb database stored in Tony\Files\database.mdb
"Tony" is the project name
here's the snippet of the Web.config file:
private ISession OpenSession()
{
Configuration c = new Configuration();
c.AddAssembly(Assembly.GetCallingAssembly());
...
I have this problem.
I have a module (module 1) that use Nhibernate to manage entity persistence; this module interacs with an other module (module 2).
The "module 2" allows to generate dynamically native SQL where clause. Now I would use it to manage filter operation in "module 1".
Which is the bast way to do it?
Is possible get the...
I recently ran across this open-source project: http://www.codeplex.com/Sculpture
Sculpture is a code-generator which allows you to design your domain model and then use persistence 'molds' such as NHibernate/EF and probably more to generate repositories. It takes care of all the mapping and Data access generation. It looks like it does...