castle-activerecord

Castle Project ActiveRecord - can it use stored procedures with SQLServer 2005?

时光总嘲笑我的痴心妄想 提交于 2019-12-01 11:24:46
I am new to Castle Project ActiveRecord. I have starting getting my hands dirty and I just seen that It can generate for you the schema, add data, update data to the schema. There are advantages of using stored procedures in SQL Server 2005, one of them being they are precompiled. Is there a way of telling Active Records to use a particular stored procedure when inserting/editing data to the schema? ActiveRecord uses NHibernate. See here for information on how to use stored procedures with it: http://ayende.com/Blog/archive/2006/09/18/UsingNHibernateWithStoredProcedures.aspx 来源: https:/

Return entity via projection query

感情迁移 提交于 2019-11-30 23:37:37
Is it possible to return an entity using a projection query? I've successfully done it with a SQL query (see below), but can't find how to do it with a projection query. Dim sql As String = "SELECT {a.*}, {b.*} FROM a LEFT OUTER JOIN b ON a.pk = b.fk") ' Convert SQL results into entities {a} and {b} Dim query As IQuery = session.CreateSQLQuery(sql) _ .AddEntity("a", GetType(a)) _ .AddEntity("b", GetType(b)) Return query.List() Yes, you can return entities from projection queries. If you are using a HQL query you can specify a constructor for the given class in the HQL select clause: IList<Foo>

.NET ORM solution with class auto-generation: Subsonic, Castle AR, …?

为君一笑 提交于 2019-11-30 19:48:14
I used to work with a custom data mapping library, and curently I'm trying to switch to a more widespread ORM solution. After some experimentation, I refined my requirements to the following: able to generate usable classes from database schema (SQL Server support is enough), support for ActiveRecord pattern, programmaticaly configurable (via code or attributes, no HBM files), free. Could you please recommend one? So far I have tried: Subsonic 3.0 The one I currently like most, as it feels like a good balance between functionality and simplicity. What I don't like: uses IQueryable<> and plural

which open source project(s) uses the castle activerecord?

穿精又带淫゛_ 提交于 2019-11-30 16:06:31
问题 Rather than the demos can you suggest any open source projects using castle activerecord for code study? 回答1: There are quite a few on google code. Some of them are: winecellarmanager mr-blogengine storyverse gaia-sprint Storm the Castle Issuetracker.Net 来源: https://stackoverflow.com/questions/327475/which-open-source-projects-uses-the-castle-activerecord

How to use Linq with Castle ActiveRecord

安稳与你 提交于 2019-11-30 10:03:01
I am playing around with Castle ActiveRecord and noticed that the download included the file, Castle.ActiveRecord.Linq.dll . I haven't found any documentation for using Linq with ActiveRecord, only some old blog posts . What is the usage pattern? Is Castle.ActiveRecord.Linq ready for production use? Yes, Castle.ActiveRecord.Linq is production ready. It's included in the latest ActiveRecord release. The actual Linq provider is implemented in NHibernate.Linq.dll, the ActiveRecord Linq dll is a thin pass-through layer. There are basically two ways to use it: Make your entities inherit from

Custom query with Castle ActiveRecord

好久不见. 提交于 2019-11-29 10:24:22
问题 I'm trying to figure out how to execute a custom query with Castle ActiveRecord. I was able to run simple query that returns my entity, but what I really need is the query like that below (with custom field set): select count(1) as cnt, data from workstationevent where serverdatetime >= :minDate and serverdatetime < :maxDate and userId = 1 group by data having count(1) > :threshold Thanks! 回答1: In this case what you want is HqlBasedQuery . Your query will be a projection, so what you'll get

Nhibernate HQL where IN query

给你一囗甜甜゛ 提交于 2019-11-29 06:10:37
Im trying to return a SimpleQuery list that queries a single table and uses IN. I can get this to work using return new List<Jobs>( ActiveRecordMediator<Jobs>.FindAll(Expression.In("ServiceId", ids)) ); However this is really really really slow. So id like to do something like this SimpleQuery<Job> query = new SimpleQuery<Job>(@"from Job as j where ? in (j.ServiceId)", ids); return new List<Job>(query.Execute()); However I cant get the SimpleQuery to work. I cant find any documentation covering this and was hoping someone out there would be able to help. Thanks Noel Have a look at the