fluent-nhibernate

Issuewith NHibernate, Fluent NHibernate and Iesi.Collection. What would you try next?

家住魔仙堡 提交于 2019-12-10 01:15:55
问题 I'm extremely new to NHibernate so I apologize if I missing something trivial here. I am currently working through a book titled "NHibernate 3 Beginners Guide" from packtpub. I have mostly been following the directions in the book. When I say mostly I have diverged by using MySQL instead of MSSQL and have been using NuGet rather than downloading the binaries by hand. I am in Chapter 2 at the moment which is the first real coding chapter. In this chapter I am building a simple WPF application

Hibernate ordering in sql

核能气质少年 提交于 2019-12-10 00:25:18
问题 Is it possible to sort the Set collection using hibernate, in sql without using SortedSet interface, without using @OrderBy annotation - just using criteria's addOrder. I've tried it and it adds order by clause but the set isn't sorted. I use hibernate 3.4. 回答1: NHibernate Sets don't have "order" even though the set mapping supports an order-by. See Ayende's explanation: Note that [order-by] does not work with generic sets and that in general, you don’t want to rely on those ordering

How do you do additional filtering on a HasMany mapping in Fluent nHibernate?

霸气de小男生 提交于 2019-12-09 23:22:18
问题 In a project I'm working on, I have four entities(amongst a bunch of others), WorkOrder, Crew, CrewAssignment, and Contractor. Their relationship is like this: A WorkOrder has one Contractor, which can be changed A Crew only ever has one Contractor A CrewAssignment only ever has one Crew A WorkOrder has many CrewAssignments The problem I'm having is setting up the last part where a WorkOrder can have multiple CrewAssignments. What I want to do is ensure that the WorkOrder.CrewAssignments

NHibernate Postgresql DateTime to Time Conversion

半腔热情 提交于 2019-12-09 21:44:49
问题 I'm using Fluent NHibernate to configure my mappings everything works when reading data but when trying to insert or update records that have a Postgresql type of Time I get the error message "ERROR: 42804: column \"run_time\" is of type time with time zone but expression is of type timestamp without time zone" It looks like NHibernate might be confused on which DbType to convert the DateTime to as you can see from PostgreSQL and C# Datatypes that there are several DbTypes that DateTime map

nhibernate - queryover - how to make dynamic sorting for joined queries

送分小仙女□ 提交于 2019-12-09 20:05:48
问题 I have a user accounts table in admin panel and this table holds data from different db tables (tables in SQL database ). And user accounts table has to support paging and sorting. When I try to sort data with "FirstName" fetched from Account db table , .net throw an exception saying Location db table does not have "FirstName" column. My method is like: Account acc = null; //bunu bu şekilde tanımlamadan olmuyor :S AccountLogin accl = null; //bunu bu şekilde tanımlamadan olmuyor :S Program

Fluent NHibernate mapping of a bi-directional, many-to-many association using an association class

▼魔方 西西 提交于 2019-12-09 19:00:15
问题 I have a bi-directional, many-to-many association between EntityA and EntityB and I’m using an association class, EntityABLink, to model this because there are other attributes about the relationship that I need to track. In addition, I also have another class that holds a reference to a specific relationship between EntityA and EntityB so I treat the association class as a full-fledged entity. In EntityA I have a read-only property that returns a list of associated EntityB objects and,

currentsessioncontext fluent nhibernate how to do it?

人走茶凉 提交于 2019-12-09 16:01:20
问题 I am trying to use fluent with session per request. I am following a "recipe" from nhibernate cookbook however it uses the nhibernate config file. I am not sure what is better but right now I am sticking with fluent config just because I would not know how to set the nhibernate config file to use fluent mapping and vanilla nhibernate mapping(hbm files). namespace Demo.WebUI { public class MvcApplication : NinjectHttpApplication { public static ISessionFactory SessionFactory { get; private set

Fluent NHibernate N+1 issue with complex objects

旧时模样 提交于 2019-12-09 14:54:52
问题 I'm having a problem with NHibernate querying the database way too many times. I just realized it likely relates to the n+1 problem but I can't figure out how to change my mappings to solve the problem. As you will see, my attempts involve specifying not to lazy load other objects, but it doesn't seem to do the trick. This is the query: public IQueryable<Report> ReadAll(DateTime since) { return m_session.QueryOver<Report>() .JoinQueryOver(r => r.Mail) .Where(m => m.Received >= since) .List()

Problem with Nhibernate.Bytecode.Castle in MSBuild (TFS)

回眸只為那壹抹淺笑 提交于 2019-12-09 13:36:20
问题 We have a Fluent NHibernate mapping test that is passing on our local machines, but when we check in to TFS, the tests are failing on the build server. We are using MSTest. The error we get is: NHibernate.Bytecode.UnableToLoadProxyFactoryFactoryException: Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle' during configuration of proxy factory class. Possible causes are: - The NHibernate.Bytecode provider assembly was not deployed. - The typeName

Setting up one to many relationship with Fluent Nhibernate

跟風遠走 提交于 2019-12-09 13:09:30
问题 I'm having a bit of an argument with my co-worker that I can't seem to find an answer to yet this is very basic stuff. Establishing one-to-many relationship in Fluent Nhibernate entity. Let's take Roles and users for example. A role can be assigned to multiple users so I made my entity guts looks like: public class User { [Required] public virtual string FirstName { get; set; } public virtual Role Role { get; set; } } and role public class Role { [Required] public virtual string Name { get;