[fluent-nhib] Re: Please somebody help me out of this nightmare.!!

2010-07-24 Thread Chris C
As a side note, you don't have to have a reference, you just have to ensure that DLL and thouse it uses are copied into the bin folder when building. One simple way is adding a reference, the other is adding the DLLs to the project with a build action of “copy if newer”. On Jul 20, 4:58 pm, Paul H

[fluent-nhib] Re: Composite ID Mapping

2010-06-25 Thread Chris C
Ah sorry, you're using a class there for the key, so you want: CompositeId(x => x.Zone).KeyProperty(x => x.BusinessCode).KeyProperty(x => x.ZoneCode); On Jun 25, 7:54 pm, Chris C wrote: > Should be as simple as, CompositeId().KeyProperty(x => > x.BusinessCode).KeyP

[fluent-nhib] Re: Composite ID Mapping

2010-06-25 Thread Chris C
Should be as simple as, CompositeId().KeyProperty(x => x.BusinessCode).KeyProperty(x => x.ZoneCode); On Jun 23, 3:41 pm, Berto wrote: > Hi, > I have a problem with a composite-id mapping on a legacy database. How > can I create a mapping like this with Fluent Nhibernate?? > > >     >       >  

[fluent-nhib] Re: NaturalId Support

2010-06-17 Thread Chris C
erty mapping of Name found > in Scala.Map > > I use this create script: > > Fluently. >                 Configure() >                 .Database(MySQLConfiguration.Standard.ConnectionString(c > => c >                                  

[fluent-nhib] Re: AutoMapping Children ... again

2010-06-13 Thread Chris C
NHibernate is really intended to always use transactions. The newer versions tend to complain unless you turn of the transaction checking. If you don't create a transaction the database will have to create an implicit one per statement anyway. On Jun 12, 8:49 am, Derek Greer wrote: > I usually u

[fluent-nhib] Re: Strange HiLo Issue

2010-06-01 Thread Chris C
; > I'm just using default hilo settings.  I'm recreating the DB with > > SchemaUpdate/Export beforehand, and the Hibernate_Unique_Key table > > with the next_hi column is being created correctly. > > > Here's the original mapping line that works: > > >

[fluent-nhib] Re: Fluent NHibernate fetching view without unique identifier

2010-06-01 Thread Chris C
NHibernate always requires a unique key of some kind when mapping tables/views to entities. On May 28, 7:53 am, Stig wrote: > I'm trying to map a view without an identifier, but nhibernate still > generates a sql with the id column (giving me a sql error, since the > ID column does not exists in

[fluent-nhib] Re: Mapping inherited classes

2010-05-21 Thread Chris C
AA should be a SubclassMap and you should use the same Type column to discriminate all sub-classes for that hierarchy. Any other way doesn't really make sense to NHibernate as the base table is telling NHibernate "I'm a class of type AA" then the "AA" table is trying to tell NHibernate, "no actual

[fluent-nhib] Re: Polymorphism: mapping

2010-05-11 Thread Chris C
only use one subclass strategy per class; you > > can't mix them. Unless I'm mistaken, this is an NHibernate restriction > > rather than a Fluent design decision. > > > On Mon, May 10, 2010 at 9:28 AM, Dana Efros wrote: > > >> Hi, All > >> I have 4

[fluent-nhib] Re: Custom MembershipProvider, HttpModule, and uninitialized Session

2010-04-05 Thread Chris C
MembershipProvider is based upon a singleton pattern, you'll only get one MembershipProvider for the lifetime of the application, so you can't inject a specific session into it. Only way to handle this is to inject a session factory into it and have it create its own session, or inject an ICurrent

[fluent-nhib] Re: Bugs or misue? Multiple results and incorect one-to-many

2010-03-28 Thread Chris C
> > I don't think so. Because if I replace a linq query with this: > var docs = session.CreateCriteria().List(); > > I get expected results. What's puzzling at this point, though, is that > I see a single select statement **with no joins** (select ... from > Document) so I don't know really where N

[fluent-nhib] Re: Bugs or misue? Multiple results and incorect one-to-many

2010-03-27 Thread Chris C
> > Question 1: What am I doing wrong and how can I eager load > subentities? > This is standard behavior for NHibernate, when using the criteria api you would use the DistinctRootEntity transform, I can only assume that maps to LINQ's Distinct since I havn't used LINQ to NH yet. > > Question 2:

[fluent-nhib] Re: Fluent NHibernate quotes all fields?

2010-01-29 Thread Chris C
Should quoting fields like this be the responsibility of Fluent NHibernate? What about using hbm2ddl.keywords and SchemaMetadataUpdater as demonstrated in http://fabiomaulo.blogspot.com/2009/06/auto-quote-tablecolumn-names.html ? With an opt-in/out option for its use as part of the fluent configur

[fluent-nhib] Re: HasManyToMany with custom type

2010-01-28 Thread Chris C
have this problem to map: > > tblProgram > { >   int programID (PK) >   String Program Name > > } > > tblProgramType > { >   int programTypeID (PK) >   String programTypeName > > } > > tblProgramProgramTypes > { >   int ProgramID        (PK) &g

[fluent-nhib] Re: Prevent SCOPE_IDENTITY

2010-01-11 Thread Chris C
Also worth checking out is http://nhforge.org/blogs/nhibernate/archive/2009/03/20/nhibernate-poid-generators-revealed.aspx which has a comparison of the various POID (persistent object id) generation strategies. On Jan 11, 2:30 pm, clayton collie wrote: > Use >   Id(x=>x.Id).GeneratedBy.HiLo("som

[fluent-nhib] Re: Weird override problem with Fluent NHibernate and .NET 4 (via StackOverflow)

2009-12-20 Thread Chris C
Here's the fix for it http://github.com/chilversc/fluent-nhibernate/commit/34e71adbefff6ffc17a5d5f7ff6c7d70954cfaf5 Note, to run the unit tests you'll also need to have these settings, http://www.meadow.se/wordpress/?p=393 . Without them sqlite will fail, and nunit won't be able to run. On Dec 2

[fluent-nhib] Re: Guid Id field converted to hex for many to many

2009-12-20 Thread Chris C
This would be a problem with your dialect, the dialect for Oracle maps a guid as RAW(16). I'm not exactly sure on how to set it up to treat guids as strings instead, you could try asking on hibernate forums. On Dec 17, 12:38 pm, Alex McMahon wrote: > I've got 2 classes that use Guid as their Id.

[fluent-nhib] Re: NHibernate explicit fluent column mapping

2009-12-14 Thread Chris C
What if you filter the results on the SpecialUser side instead, i.e. include the where clause as part of SpecialUserMap. On Dec 15, 12:14 am, James Gregory wrote: > My bad, SpecialUser and SpecificUser are a little close for my > post-midnight brain to differentiate. > > On 12/15/09, Ethan wrote

[fluent-nhib] Re: Examples.FirstProject, create tables with Ms SQL 2008

2009-12-14 Thread Chris C
After adding the new fields did you update the mapping for the entity? On Dec 14, 11:40 am, Paul Batum wrote: > I'm not sure why your extra columns weren't generated. But I can answer your > second question regarding the Configuration parameter to the BuildSchema > method. The Configuration class

[fluent-nhib] Re: Bug with .Not and in ClassInstance

2009-12-05 Thread Chris C
Ok, I've committed a fix for this and sent a pull request. On Dec 6, 2:45 am, Chris C wrote: > I'm just pointing out potential breaking changes, should really > maintain a log of these so when publishing new releases they can be > listed. > > On Dec 6, 12:30 am, James Gr

[fluent-nhib] Re: Bug with .Not and in ClassInstance

2009-12-05 Thread Chris C
bug and it should be fixed. Well spotted. > > On 12/6/09, Chris C wrote: > > > > > This seems like a bug to me, ClassInstance only resets the value of > > nextBool if the mapping is specified: > > > E.g. > >             if (!mapping.IsSpecified("DynamicI

[fluent-nhib] Re: Convention for composite id

2009-12-05 Thread Chris C
8b1a44 and the previous 2 commits. On Nov 29, 4:09 am, Chris C wrote: > Ah yes, not sure how I managed that as it was correct at one point. > > I've fixed it now, should have been using expectedAccess. > > I've also added the remaining tests that were to do and now the o

[fluent-nhib] Bug with .Not and in ClassInstance

2009-12-05 Thread Chris C
This seems like a bug to me, ClassInstance only resets the value of nextBool if the mapping is specified: E.g. if (!mapping.IsSpecified("DynamicInsert")) { mapping.DynamicInsert = nextBool; nextBool = true; } So if we assume Dyna

[fluent-nhib] Re: Ignore FormatException

2009-12-02 Thread Chris C
Another thing to be careful of is if you are able to get nhibernate to convert invalid values to null, nhibernate will probably at some point try to persist that back to the database as null removing the value that is in there unless you mark the column as read-only. On Dec 1, 12:00 pm, Asbjørn Ul

[fluent-nhib] Re: Can't seem to combine Column and Length

2009-12-01 Thread Chris C
I've seen the problem, defaultColumn is not updated in PropertyPart after clearing the column collection. As setting the column name in the overload also calls propertyMap.Column(columnName) it won't work either way. PropertyPart.cs public PropertyPart Column(string columnName) {

[fluent-nhib] Re: Convention for composite id

2009-11-28 Thread Chris C
> > > > On Wed, Nov 4, 2009 at 11:40 AM, Chris C wrote: > > > Is there a convention that targets composite keys that use > > WithKeyProperty / reference. It's the key properties and references > > I'm actually after in this case, as I'm trying to mak

[fluent-nhib] Re: map an enum to int value

2009-11-08 Thread Chris C
Developer, Team Lead Backup (.Net Technologies) – Applications > Delivery - TDG > Injazat Data Systems > P.O. Box: 8230 Abu Dhabi, UAE. > > Phone:  +971 2 6992700 > Direct:   +971 2 4045385 > Mobile:  +971 50 2623624, +971 55 2017 621 > > E-mail: eng.mel...@gmail.com > Weblog:http://

[fluent-nhib] Re: map an enum to int value

2009-11-07 Thread Chris C
You're problem is in the mapping file. A convention won't overwrite a mapping if there is one, this makes it easy in a convention to set defaults if a value hasn't been provided by the mapping but without having to ensure you're not overwriting an existing mapping. In you're mapping itself you're

[fluent-nhib] Re: Timestamp properties aren't auto-mapping

2009-11-04 Thread Chris C
I've just been setting core.autocrlf to false, as when it was true git kept saying the whole file had changed (same as what you seem to be suffering). On Nov 4, 2:43 pm, Jon Kruger wrote: > I came up with a fix that seems to be working for me, and all of tests > pass.  I'm still learning Git, so

[fluent-nhib] Convention for composite id

2009-11-03 Thread Chris C
Is there a convention that targets composite keys that use WithKeyProperty / reference. It's the key properties and references I'm actually after in this case, as I'm trying to make the this test pass: http://github.com/chilversc/fluent-nhibernate/blob/access-convention/src/FluentNHibernate.Testin

[fluent-nhib] Setting the key of a one-to-many mapping to not nullable

2009-10-23 Thread G C
Does Fluent currently support setting the key column of a one-to-many mapping as not nullable? For example, generating the following xml: ... If so, how can this be achieved? Thanks, Gen --~--~-~--~~~---~--~~ You received this message because you a

[fluent-nhib] Property access convention

2009-10-21 Thread Chris C
What I want is a convention for property access, i.e. all properties should use either Access.BackField() or Access.CamelCaseField() unless an explicit access type has already been set. Initially I tried using IPropertyConvention but this only applied to properties and not references, one-to-many

[fluent-nhib] Re: Is it possible to map property to formula with FH?

2009-10-05 Thread Chris C
On Oct 1, 1:53 pm, Anatoly wrote: > Is it possible to map property to formula with FH like this: > >     >     >     >     >     >     type="Int32"/> Certainly, Map.(x => x.DayOfWeek).Formula("DATEPART(dw, Time) - 1") --~--~-~--~~~---~--~~ You received this

[fluent-nhib] One-To-One mappings for subclass joins

2009-08-31 Thread G C
When I create a table-per-subclass with discriminator (using SubclassMap(){ Join{ ...}), if the JoinPart contains a one-to-one mapping, then that mapping doesn't seem to be generated in the NH config. --~--~-~--~~~---~--~~ You received this message because you are

[fluent-nhib] AutoMap / 2nd Level Cache issue?

2009-08-20 Thread Ed C.
Hi, I have an automapped "ShortUrl" entity and would like to enable second level caching for. My configuration uses the old fashioned hibernate.cfg.xml, so I added: true NHibernate.Caches.SysCache.SysCacheProvider, NHibernate.Caches.SysCache (and the NHibernate.Caches.SysCache Ass

[fluent-nhib] 1.0RC bug? (Reserved words in table/column names) (Incorrect syntax near the keyword 'User')

2009-08-16 Thread Ed C.
Hi, I just upgraded to 1.0RC. However, it looks like FNH has stopped escaping table & column names with ` in the mapping XML (so the runtime SQL isn't surrounding them with square brackets []) Is there a new convention, or nhibernate configuration property, I can enable? (My "User" entity is Au

[fluent-nhib] Re: In the nhib2.1 folder, the version of NHibernate.dll is 2.0.1.4000?

2009-02-17 Thread C+++
ok, I admit, a little bit :D On Tue, Feb 17, 2009 at 11:59 PM, James Gregory wrote: > That looks a little bit involved for my liking... ;) > Applied, thanks! > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Flue

[fluent-nhib] Re: ManyToOneConvention for Foreign Keys (not Naming)

2009-02-14 Thread Ed C.
running into is unrelated: I'm using a SQLite .db file as my test database, and the SchemaExport() tool is not emitting the foreign key creation SQL code. Sorry for the noise. On Feb 14, 6:16 pm, "Ed C." wrote: > Hi, list -- > > I'm using the AutoPersistenceModel

[fluent-nhib] Re: FluentNhibernate and BurrowFramework

2009-02-14 Thread Ed C.
+1 We're also using burrow, and passing around the Configuration would be great! On Feb 10, 9:22 pm, Paul Batum wrote: > James, could we add an overload for the Fluently.Configure method that takes > an existing Configuration? That would probably give Mark a nicer alternative > here. > > Paul >

[fluent-nhib] ManyToOneConvention for Foreign Keys (not Naming)

2009-02-14 Thread Ed C.
reignKey() (I have recently discovered the joys of FNH - thanks for all the hard work!) Thanks for your time, Ed C. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to t

[fluent-nhib] Re: Auto Mapping blog posts

2009-01-12 Thread Peter Bromberg [C# MVP]
James, Excellent work. I can assure you it is much appreciated. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.com To u

[fluent-nhib] Re: Enumerations and Mapping

2008-10-07 Thread Brian C
=> x.Id, "AccountId"); > >>   Map(x => > >> x.Type).TheColumnNameIs("admAccountTypeId").CustomTypeIs(typeof > >> (AccountType)); > >>   Map(x => > >> x.Status).TheColumnNameIs("admAccountStatusId").CustomTypeIs(typeof &g

[fluent-nhib] Enumerations and Mapping

2008-10-06 Thread Brian C
I have defined a class called Account that has three properties whose types are three different enumerations. The properties are named "Type", "Status" and "LeadStatus," and they are of type "AccountType", "AccountStatus" and "LeadStatus" respectively. These values are stored as FK integers in a S