I am relatively new to both WPF and NHibernate and attempting to build an application that combines the two, using the MVVM pattern. However, I am struggling to understand when and where my application should open and close NHibernate sessions and transactions.
From what I have read, it is recommended that sessions should be kept as sho...
Instinctively, I would say that this is impossible, as NHibernate needs to know some mapping information on how to persist a given type. Thus, I encountered some situations in which I could use such a feature. For instance, through a named query or something like so. On the other hand, using a named query would require me to make an addi...
How can I inject my own ConnectionString if using Castle Active Record?
...
We are trying to model a school system hierarchy from State>County>District>School, hence we are using the model below to describe the parent child relationship along with organization type (i.e. School, District,…).
Organization Hierarchy
Now we need to store details on each particular organization, for example if it’s a school we n...
Possible Duplicate:
Use Component as IDictionary index in AsMap in Fluent Nhibernate
Hi,
I have an class with an IDictionary on it.
<map name="CodedExamples" table="tOwnedCodedExample">
<key>
<column name="OwnerClassID"/>
</key>
<index type="string" column="ExampleCode"/>
<many-to-many class="CodedExa...
I have an ASP.NET v2 website which uses NHibernate for ORM. My current architecture is not that great and I will be changing it after reading some best practices but I wish to still try and figure out my current problem.
I have a login screen which creates a ISessionFactory with the connection string set appropriately to the user name ...
I am having problems getting NHibernate to generate a SQL query that actually runs without errors, as the query is missing joins for my subclasses.
Lets take this minimal example:
class Page
{
public virtual int Id { get; set; }
public virtual string UrlSegment { get; set;}
public virtual Page Parent { get; set; }
}
class ...
I have class called 'Tool'. Tool has properties like: Name, Description and some specific others. Tool is special because Name and others are read only but description can be modified by users.
Count of tools is constant and known at development time. It is not Value Object because I need to query them and show to users where they can u...
Simple question: Is LINQ-to-NHibernate stable and feature-complete enough to be used for production code ? What are the limitations ?
NOTE : I am aware that this is a duplicate of this question, but the last answer is over a year old, so the answers might or might not be relevant any longer.
...
What's best shared cache provider for NHibernate ?
Providers pros & cons are welcome !
...
I don't found they repository, and here I don't see any questions about it.
Is this project still alive?
Does anyone use it?
...
List<object[]> products = GetSession().CreateCriteria<Product>()
.SetProjection(Projections.ProjectionList()
.Add(Projections.Property("Id"))
.Add(Projections.Property("Name"))
.Add(Projections.Property("Price"))
)
...
I know that NHibernate is a very powerful ORM but SubSonic is not known for me.
please give me a little information about SubSonic and tell me that What is the difference between Nhibernate and SubSonic ?
...
How to use 2nd Level Cache with NHibernate.Search ?
I tried to enable SetCacheable on FullTextQuery, but it doesn't work.
var session = Search.CreateFullTextSession(database.Session);
session.CacheMode = CacheMode.Normal;
var textQuery = session.CreateFullTextQuery(query, new[] { typeof(Job) });
textQ...
I have the following criteria search that I would expect to return 1 project with multiple task and contexts and a single user.
What is actually getting returned is the same project multiple times for each different task.
It almost looks like I am missing a statement in the criteria to tell the search to return unique projects.
Any he...
Is it possible to join 3 ICriteria together with OR statement not AND?
ICriteria criteriaCity = NHibernateSession.CreateCriteria(typeof(Advertisements))
.CreateCriteria(AdvertisementsProperties.City.ToString(), "city").
Add(Restrictions.Or(
Restrictions.Like("city." + CitiesProperties.Name.ToS...
We've been looking at using an ORM at work.
Currently we are trying to way up the pro's and con's of fluent nhibernate against castle active record.
We are unsure of the flexibility of each as our database isn't very conventional. It lacks foreign keys and identities on the primary keys (A little confusing but the next value is stored ...
Hi,
Using SQL Server 2005 I have a table that contains a bit field. When the table is viewed, the console automatically translates this to true/false.
So I'm trying to query this with nHibernate to match all records for which this field is "true", like this:
Dim results As ArrayList = session.CreateCriteria(Of DataTransferObjects....
Hi guys, I would like to ask on how you do ordering on an object with 2 properties that are basically joined from 2 entities.
Lets say "ClassA" has a property named ClassB and ClassC which are also classes themselves. ClassB has a property named Name and ClassC also has a property named Name. Now, since ClassB and ClassC are both proper...
Context =>
Calling wcf, some random stored procedures and sql stuff theoretically imports some data.
Requirements =>
Reindex lucene indexes for some of imported entities.
Question =>
What's the easiest way to do that?
Theoretically, if nhibernate is initialized, nhibernate.search should be aware which entities are supposed to be ind...