nhibernate

nHibernate Euro symbol € change for character ¿

蹲街弑〆低调 提交于 2021-01-28 08:22:37
问题 I've tried save a Euro Symbol € using NHibernate and FluentNHibernate in a database Oracle 11g. I have checked a log from NHibernate and see the generated sql statement: UPDATE CURRENCY SET DESCRIPTION = 'Euro', SYMBOL = '€', WHERE ID = 63 When the query from table CURRENCY execute, the column SYMBOL returns ¿ I've tried change the FluentNHibernate Mapping for the column SYMBOL using AnsiString , like this: Map((x) => x.Symbol).Column("SYMBOL").CustomType("AnsiString").Not.Nullable(); But it

NHibernate batch insert not working

此生再无相见时 提交于 2021-01-28 04:48:31
问题 I am trying to get NH batch insert to work to migrate some old data to our new DB. For a test sample I have configured batch size like so: <property name="adonet.batch_size">25</property> and in a stateless session I insert some 1000 objects before committing the transaction. The object id strategy is guid.comb and is mapped as follows: <id name="Id" access="field.camelcase-underscore" type="guid" column="id"> <generator class="guid.comb"/> </id> Using NH Profiler I can see that all objects

why do you need Log4Net for nhibernate?

≡放荡痞女 提交于 2021-01-28 02:09:30
问题 I am going to build my application using asp.net mvc3 and nhibernate 3.2. I decided to use Elmah to log all the error messages. I remember nhibernate supports log4net and use it to log all queries. If I dont care about outputting the queries to the log file, I can use nhibernate profiler to do that, what other reasons will stop me swtiching from log4net to Elmah? 回答1: Well, whether you actively use the logging abilities of NHibernate or not, the NHibernate library's code has dependencies on

NHibernate One-To-One Relationship

こ雲淡風輕ζ 提交于 2021-01-27 17:10:32
问题 I have the following Domain Model(s) : public class WriteOffApprovalUser { public virtual string UserName { get; set; } public virtual Employee Employee { get; set; } } public class Employee { public virtual string EmployeeID { get; set; } public virtual string EmployeeStatusCode { get; set; } public virtual string FirstName { get; set; } public virtual string LastName { get; set; } public virtual string PreferredName { get; set; } public virtual string JobTitle { get; set; } public virtual

Is a ORM the right tool to use for migrating data?

一曲冷凌霜 提交于 2021-01-27 14:09:58
问题 Background We are in the process of upgrading a legacy import tool, what it does is it moves data from one database attached to SQL Server to a 2nd database on the same server with a different schema performing the translations and mapping along the way. Here is a example to help explain what is happening Say the source database has one table called Client_Info and the destination table has two tables named Clients and Cities Source.dbo.Client_Info +-----------+----------+----------+-------+

Inject service into Nhibernare Envers to customize revision entity

╄→尐↘猪︶ㄣ 提交于 2021-01-26 02:08:46
问题 I'am using NHibernate and envers in a .net 5 web application, i need to add user id to default revision entity and find no way to use dependency injection to do it. this is envers configuration private static void SetupEnvers(NHibernate.Cfg.Configuration cfg) { var enversConf = new NHibernate.Envers.Configuration.Fluent.FluentConfiguration(); enversConf.Audit<Persona>(); IRevisionListener revListner = new EnversRevisionListener(new IUserManagement); enversConf.SetRevisionEntity<RevisionEntity

Inject service into Nhibernare Envers to customize revision entity

左心房为你撑大大i 提交于 2021-01-26 02:07:44
问题 I'am using NHibernate and envers in a .net 5 web application, i need to add user id to default revision entity and find no way to use dependency injection to do it. this is envers configuration private static void SetupEnvers(NHibernate.Cfg.Configuration cfg) { var enversConf = new NHibernate.Envers.Configuration.Fluent.FluentConfiguration(); enversConf.Audit<Persona>(); IRevisionListener revListner = new EnversRevisionListener(new IUserManagement); enversConf.SetRevisionEntity<RevisionEntity

Inject service into Nhibernare Envers to customize revision entity

左心房为你撑大大i 提交于 2021-01-26 02:07:11
问题 I'am using NHibernate and envers in a .net 5 web application, i need to add user id to default revision entity and find no way to use dependency injection to do it. this is envers configuration private static void SetupEnvers(NHibernate.Cfg.Configuration cfg) { var enversConf = new NHibernate.Envers.Configuration.Fluent.FluentConfiguration(); enversConf.Audit<Persona>(); IRevisionListener revListner = new EnversRevisionListener(new IUserManagement); enversConf.SetRevisionEntity<RevisionEntity

37岁的老码农在找工作

最后都变了- 提交于 2021-01-13 05:49:30
作者 自由飞 来源 http://17bang.ren/Article 前几天突然接到dk的电话,要和我聊聊天。 他说他们部门调整,虽然最后他留了下来,但还是非常焦虑。人无远虑必有近忧,他这次被刺激到了,想提高一下自己,以免下次再有类似的心惊肉跳。但怎么提高呢? 程序员第一考虑的当然是技术,但现在真不知道学什么了:干了三四年的开发,手头的工作马马虎虎都没什么问题了。就算有问题,也是业务逻辑上的问题,系统太复杂,吃不透;或者系统里一些过时的/生僻的技术,真心觉得没必要花时间花精力去研究,能对付就行了,是不是?反正下家单位99.99%的几率是不会用到这些东西的的。 那么就是一些新技术了。新技术杂得很,不知道学什么,框架类库啥的其实没什么技术含量,一两个星期就可以上手,上手了之后呢?往深里学?其实和老旧技术一样的问题,谁知道下一份工作用不用得上呢!而且没趣,大概是因为没有挑战性吧,反正就那个样,还能咋的? 一直聊到这里,我都非常理解。我这个十年的老码农,体会比他还深。其实稍微干上一些年头,就是这个样子,看起来像是“学习热情下降”“懒得学习”,但本质上呢,两个原因: 1、本身的技能增强,能够应付日常工作,没有刚入行时那么大的压力了。 2、学习的边际效益递减,所以开始考虑投资/收益比了。刚入行的时候,技术一丁点的进步,都能带来非常大的成就感,至少能少挨点骂,是不是?积累到一定时候

Dapper(一) 简介和性能

ε祈祈猫儿з 提交于 2021-01-04 17:41:38
Dapper的简介   Dapper是.NET下一个micro的ORM,它和Entity Framework或Nhibnate不同,属于轻量级的,并且是半自动的。Dapper只有一个代码文件,完全开源,你可以放在项目里的任何位置,来实现数据到对象的ORM操作,体积小速度快。 使用ORM的好处是增、删、改很快,不用自己写sql,因为这都是重复技术含量低的工作,还有就是程序中大量的从数据库中读数据然后创建model,并为model字段赋值。这些ORM都可以轻松给你搞定。ORM给我们开发带来便利时,性能也是一个让我们不得不考虑的问题。一般的ORM性能和直接写原生的sql比都差不少,但是Dapper性能还很错,甚至和DbHelperSQL方式性能高出很多。 Dapper的优势 Dapper是一个轻型的ORM类。代码就一个SqlMapper.cs文件,编译后体积小。 Dapper很快。Dapper的速度接近与IDataReader,取列表的数据超过了DataTable。 Dapper支持多数据库。诸如:Mysql,SqlLite,Mssql系列,Oracle等一系列的数据库。 Dapper的R支持多表并联的对象。支持一对多 多对多的关系。并且没侵入性,想用就用,不想用就不用,无XML无属性,代码以前怎么写现在还怎么写。 Dapper原理通过Emit反射IDataReader的序列队列