One of the things that get me thoroughly confused is the use of session.Flush,in conjunction with session.Commit, and session.Close.
Sometimes session.Close works, e.g., it commits all the changes that I need. I know I need to use commit when I have…
Now, before you say it: I did Google and my hbm.xml file is an Embedded Resource.
Here is the code I am calling:
ISession session = GetCurrentSession();
var returnObject = session.Get(Id);
Here is my mapping file for the class:
As someone who hasn't used either technology on real-world projects I wonder if anyone knows how these two complement each other and how much their functionalities overlap?
Not sure how I can fix this, trying to do a unit test on the method "GetByTitle"
Here are my definitions:
public class ArticleDAO : GenericNHibernateDAO(IArticle, int>, IArticleDAO
{
public IArticle GetByTitle(string title)
{
IQuery…
For example, I want to populate a gridview control in an ASP.NET web page with only the data necessary for the # of rows displayed. How can NHibernate support this?
I have a HQL query that can generate either an IList of results, or an IEnumerable of results.
However, I want it to return an array of the Entity that I'm selecting, what would be the best way of accomplishing that? I can either enumerate through…
I'm writing an integration test where I will be inserting a number of objects into a database and then checking to make sure whether my method retrieves those objects.
My connection to the database is through NHibernate...and my usual method of…
Has anyone implemented this, or know if it would be difficult to implement this/have any pointers?
public static SpatialRelationCriterion IsWithinDistance(string propertyName, object anotherGeometry, double distance)
{
// TODO: Implement
…
How do I use the Inverse Attribute? If I am not mistaken, for one to many relationships the inverse attribute must be set to true. For many-to-many relationships, one of the entity class inverse attributes must be set to true and another set to…
I notice sometimes with my parent/child objects or many-to-many relationships, I need to call either SaveOrUpdate or Merge. Usually, when I need to call SaveOrUpdate, the exception I get on calling Merge has to do with transient objects not being…
Question says it all really, the default is for it to map as a string but I need it to map as an int.
I'm currently using PersistenceModel for setting my conventions if that makes any difference.
Update
Found that getting onto the latest version of…
I have a class called ReportRequest as:
public class ReportRequest
{
Int32 templateId;
List entityIds;
public virtual Int32? Id
{
get;
set;
}
public virtual Int32 TemplateId
{
get { return…