Hi,
This has been a 2 week battle for me so far with no luck. :(
Let me first state my objective. To be able to search entities which are tagged "foo" and "bar". Wouldn't think that was too hard right?
I know this can be done easily with HQL but since this is a dynamically built search query that is not an option. First some code:
p...
What are the advantages/disadvantages of using NHibernate ?
What kind of applications should be (& should not be) built using NHibernate ?
...
Can I use a Criteria to execute a t-sql command to select the max value for a column in a table?
'select @cus_id = max(id) + 1 from customers'
Ta
Ollie
...
We are trying to come up with an architecture approach for designing an application where front end runs as a browser based xaml app.
this app contacts services on the web server that are built using wcf, the wcf services host domain model that uses nhibernate for persistence (so it is hibernate aware by using interfaces for lists and s...
Suppose I want entries in the table Regions to have a type, e.g. a city, a country etc. What's the accepted way of storing this type, assuming I'll be using O/RM (NHibernate in my case) ? I see two options:
Have an enum in the C# bussines layer with the types and store the type as a tinyint in the table.
Have a lookup table RegionType...
I am using the HybridSessionBuilder supplied by Palermo and his team .. link ..
We have our staging environments set up so that the url will be one of the following based on the environment
web-test.company.com
web-cert.company.com
web.company.com
what we normally do is take a look at the url and if it has "-test" we use the test co...
Say you have a table named Articles.
It has the following columns:
ID, name, body, created, modified, pageviews, etc.
Using a single method, would it be possible to pull a list of articles, and pass it which column I want to order by? And also the direction, i.e. desc or asc.
...
My development group is about to release a version of an internal framework that uses NHibernate (and Spring.NET) for persistence. Developers currently using our internal framework use ADO.NET for persistence, so going forward they will use a combination of ADO.NET and NHibernate. During testing of the NHibernate, we found out that the N...
Basic order of execution:
A collection of PersistentObjects is queried then cached separately from the session.
The collection is passed to a module that needs to reattach them to the session in order to lazily load some of the properties (using session.Lock(obj, LockMode.None)).
After the module has completed processing, another modul...
Hi,
I am building a web application, and whenever I make a database call I need a session.
I understand creating a session object is very expensive.
I am following the repository pattern here: http://blogs.hibernatingrhinos.com/nhibernate/archive/0001/01/01/the-repository-pattern.aspx
He uses something called a UnitOfWork to get the ...
Hi,
I am using fluent for mappings in my web application that uses nhibernate (just setting it up!).
Do I use fluent for the database configuration file or I use fluent for that?
...
Hi
I'm using fnh and castle nhib facility.
I followed the advice from mike hadlow here: http://mikehadlow.blogspot.com/2009/01/integrating-fluent-nhibernate-and.html
here is my FluentNHibernateConfigurationBuilder:
public Configuration GetConfiguration(IConfiguration facilityConfiguration)
{
var defaultConfigurationBuild...
Yo
i have the following nhibernate class:
public class User
{
public virtual int Id { get; set; }
public virtual string FullName { get; set; }
public virtual IList<RatingItem> RatingItems { get; set; }
public User()
{
RatingItems = new List<RatingItem>();
}
public virtual void AddRatingItems(R...
I'm pottering around with Fluent NHibernate to try and get a simple app up and running. I'm running through this Fluent NHibernate Tutorial.
Everything seems to be going fine and I've created the required classes etc. and it all builds, but when I run the test, I get an exception. Someone in the comments section of the tutorial has t...
I've recently started using NHibernate and have very little experience.
I have table Projects which can't be changed since it's a part of older system. I need to add ProjectGroup table represeting group of project, so that one project is assigned to only one particular group and group can have many projects assigned to it. I wonder if ...
I want to specify a column of my domain object which will be of Type Product lets say. Instead of this being a normal relationhip like one to one for example or one to many etc... I want this property to be a product, but also it is the most sold product.
So if I have an Object called ProductCategory
public class ProductCategory{
...
Hi,
I have a class library with all my nhibernate code (domain/mappings using fluent).
Now I am just doing some simple tests in a console application, and I am getting an error saying it can't find the configruation file in /bin/debug
I have the file in /consoleTests/hibernate.cfg.xml
Why would it be looking in the /bin/debug folder...
Hi,
I am using nHibernate and fluent.
I created a User.cs:
public class User
{
public virtual int Id { get; set; }
public virtual string Username { get; set; }
public virtual string Password { get; set; }
public virtual string Email { get; set; }
public virtual DateTime DateCreated { get; se...
Is there a way in NHibernate to start with an unproxied model
var m = new Model() { ID = 1 };
m.Name = "test";
//Model also has .LastName and .Age
Now save this model only updating Name without first selecting the model from the session?
...
HEllo,
I'm using nhibernate and have problems regarding user registration on my site.
When user wants to register I create new user record in the database and immidiatelly after that the system is logging the user in.
Well here lies the problem... When creating user record I'm using
NHibernateSession.Save(entity); //does not saves u...