How to override S#arp architecture automapping with HBM files?
I'm facing problems with composite keys in S#arp architecture. Anyone have an example of how to do that or how to use mapping files with automapping? ...
I'm facing problems with composite keys in S#arp architecture. Anyone have an example of how to do that or how to use mapping files with automapping? ...
Hi, Got a weird nHibernate problem. I have a table called AssetRule which is being mapped with the following code: Public Class AssetRuleMap Inherits FluentNHibernate.Mapping.ClassMap(Of AssetRule) Public Sub New() Id(Function(x) x.Id) Map(Function(x) x.PageType).CustomType(Of PageType)() Map(Function(x) x.Path) Map(Fu...
Hi all, I have a table that references many items. In the general view, I don't want to load all these references, for obvious performance reasons, but in the global view, I would like to load the same table, with all the references. I tried making two classes mapped on the same table, but it loads the two classes when loading the table...
Is there a way to map an XML field using Fluent Nhibernate. If you have an XML field in MSSQL database, how would you Map using Fluent NHibnernate? Example Table("Address"); LazyLoad(); Id(x => x.AddressId).GeneratedBy.HiLo("1000"); Map(x => x.AddressLine1).Length(100).Not.Nullable(); Map(x =>...
I am new to fluent nhibernate. I have the following combination of table per subclass and single table with discriminator per subclass structure. Will appreciate any help in mapping this with fluent - specially with automapping: enum type {a, b, c, d} Class pool { int id; IList<Class1> aVals; IList<Class1> bVals; IList<Class2> cVals;...
If using Fluent NHibernate, is it possible to automap most classes, but specify that a couple of particular classes should be mapped using the regular fluent API rather than being automapped? And if so, can anyone point me to some sample code that shows how to do it? Thanks! ...
I am trying to create a map to get results as like from below query. I am having hard time to get set Product mapping to set References to Product_Line on 3 columns as in where condition. How can I achieve this using fluent? Product table: cId, ProjID, Line, etc., columns Product_Line table: cId, ProjID, Line, etc., columns select f.* ...
I have a security rule that a newly registered user has full permissions over their own user entity. I'm using Rhino.Security and the code works fine, but I want to create a unit test to make sure the appropriate call is made to setup the permission. Here is a simplified verison of the code: public User Register(UserRegisterTask userR...
Is it possible to map the following situation? A product class (currently a table) An account class (currently a table) An accountproduct class (currently a join table but with additional information related to a specific product and account) What I'd ideally like is accountproduct to extend product and to be available from account a...
I have a List that I am trying to get into the DB and am coming up with the following assert: {"ORA-12899: value too large for column \"GDATA\".\"CNVTOOLBOX\".\"TOOL\" (actual: 387, maximum: 255)\n"} I am overriding the automapping with the following: public class CnvRootMap : IAutoMappingOverride<CnvRoot> { public void Override(...
I keep searching the web for examples of the new fluent API syntax in Microsoft's Entity Framework technology previews ... I come up with bits and pieces here and there. Is there any reliable place to go to find ALL the possibilities? And maybe something that explains them a bit ("HasRequired", "WithMany", etc.)? FYI, I am specifically...
Our entities have a group of common properties. In order to reduce repetitive mapping, I created a base ClassMap that maps the identities and common properties. For each entity's ClassMap I just subclass the base and it works great. For a new project we are also letting NH generate the DB schema for us. The issue is, the order of the col...
Inside a DLL, we've defined two classes ("Class1" and "Class2") which inherit from an interface ("IInterface") and a base class ("BaseClass"). We're using the Castle Windsor's Fluent Registration API ( http://using.castleproject.org/display/IoC/Fluent+Registration+API ) to automatically register all the classes inheriting from "BaseClas...
Hello everybody. I'm having issue when I use Fluent nHibernate for mapping entities with my SQL database. To understand the problem, here is an example. This example modelizes via SQL tables a mail box, that allows users to put their mail in one or many folder (like the label system in gmail). // contains every users USER ( Id (b...
I have a process where I create multiple new entities. I've tried adding them to a collection (doing a .Persist() on them), and then when my collection is ready, trying to commit the transaction. I've checked to make sure that no database calls are being executed until I call Transaction.Commit(), but once I call commit, I see calls be...
Taking into consideration that Fluent NHibernate has been available for some time I thought that there would be a book available already so i search in amazon and in google but there is no books for fluent nhiberanet. Am i right or book already exist? ...
I have an issue with testing routes using the MVCContrib Fluent route testing. The test fails yet the application recognises the routes. Let me explain.... I have the following routes in my register (shown in order) routes.MapRoute( "PurchaseUnitsPaged", "PurchaseUnits/Page{page}", new {...
Hello, i'm trying to switch out .hbm mappings to fluent mappings an have a problem with the mapping of composite-ids and the usage of Interfaces the Class looks at follows: public class ClassWithCompositeId { public virtual IKeyOne KeyOne { get; set; } public virtual IKeyTwo KeyTwo { get; set; } } our hbm mapping looks like this...
I am having some trouble depicting a DataBase Setup in NH. I have the following Classes: public class BaseData { public virtual long Id { get; set; } } public class ExtendedData : BaseData { public virtual string Name { get; set; } } The backing tables look like the following: BaseTable -------...
I have 2 tables like this: (Please note the non-standard db schema naming) table T_Pen TP_ID TP_PrimaryColorID TP_SecondaryColorID ... table E_Color EC_ID EC_ColorName ... And I want to create a mapping of the 2 tables to a domain object Pen using Fluent NHibernate. class Pen { PenID; PrimaryColorName; Seco...