[nhusers] Re: Need Help with Dynamic Query with Aggregate Condition

2012-06-06 Thread Corey Coogan
d) .SetParameter("startDate", startDate) .SetParameter("endDate", endDate) .SetParameter("status", status) ; return query.List(); } On Jun 4, 11:09 pm, Corey Coogan wrote: > I need to

[nhusers] Need Help with Dynamic Query with Aggregate Condition

2012-06-05 Thread Corey Coogan
I need to build a dynamic query from a search form. I have been using Linq for NH and it's been great when the queries are simple. I just build the query for the passed parameters, like so: public IList GetOrdersBy(int? customerId=null, int? carId=null, string status=null) { var query = Sessio

[nhusers] Re: Flush() inside active Transaction

2010-09-14 Thread Corey Coogan
t. Since I know the actual details beyond the made-up snippit I shared, I will bow out. Thanks for all the help! Corey On Sep 14, 2:13 pm, José F. Romaniello wrote: > 2010/9/14 Corey Coogan > > > For example, constraint violation, > > You never send something that may fail due

[nhusers] Re: Flush() inside active Transaction

2010-09-14 Thread Corey Coogan
dates to > fail? > What's the use case? Concurrency? > >     Diego > > On Tue, Sep 14, 2010 at 15:35, Corey Coogan wrote: > > @Diego > > > Thanks for the advice.  I agree that it would be ideal to have designs > > that don't have to deal with exceptions,

[nhusers] Re: Flush() inside active Transaction

2010-09-14 Thread Corey Coogan
ging your design so you DON'T get exceptions as part > of your regular workflow. > >     Diego > > On Tue, Sep 14, 2010 at 15:20, Corey Coogan wrote: > > Would you elaborate what you mean by lower level?  You mean working > > directly against ADO?  I'm not eve

[nhusers] Re: Flush() inside active Transaction

2010-09-14 Thread Corey Coogan
ave to go > lower-level. > >     Diego > > On Tue, Sep 14, 2010 at 14:47, Corey Coogan wrote: > > I have a scenario that I commonly run into.  It's simple to do with a > > standard ADO Transaction, but not so much with NH (that I know of). > > > I

[nhusers] Flush() inside active Transaction

2010-09-14 Thread Corey Coogan
I have a scenario that I commonly run into. It's simple to do with a standard ADO Transaction, but not so much with NH (that I know of). I have 2 tables to update. The first contains profile information (Profile) and the other (Work) contains records changes that need to be made and the status o

[nhusers] Re: SqlQuery and AddJoin() method causing IndexOutOfRange

2010-08-13 Thread Corey Coogan
Thanks for your help. I'll try it again. On Aug 13, 9:25 am, Diego Mijelshon wrote: > That should work too (just tried) > Be sure to > checkhttp://nhforge.org/doc/nh/en/index.html#querysql-aliasreferences > >     Diego > > > > On Fri, Aug 13, 2010 at 11:20

[nhusers] Re: SqlQuery and AddJoin() method causing IndexOutOfRange

2010-08-13 Thread Corey Coogan
Foo", typeof(Foo)) >                          .AddJoin("Bar", "Foo.Bar") >                          .List(); > > That returns a list of Foo, with fully loaded Bar. > > The alias parameter is required by AddJoin, that's a mistake in the docs. > >     Diego > > > >

[nhusers] Re: SqlQuery and AddJoin() method causing IndexOutOfRange

2010-08-13 Thread Corey Coogan
he selected c.* columns contain al the > data for the Client. So, you need to add c.* to the select list. > >     Diego > > > > On Thu, Aug 12, 2010 at 17:11, Corey Coogan wrote: > > I have the SqlQuery below.  I will to eager load the Register and &g

[nhusers] SqlQuery and AddJoin() method causing IndexOutOfRange

2010-08-12 Thread Corey Coogan
I have the SqlQuery below. I will to eager load the Register and Client entities. Unfortunately, I always get an IndexOutOfRangeException - Column Name doesn't exist in the Result Set. The Policy, Register and Client entities each contain only a subset of the db tables. The Policy entity is loa

[nhusers] Enumerations in one-to-many relationships

2010-06-09 Thread Corey Coogan
Hi gang! I'm using Jimmy's Bogard's enumeration strategy described here: http://www.lostechies.com/blogs/jimmy_bogard/archive/2008/08/12/enumeration-classes.aspx It works great like a component, when some entity is using it for a status or something. I'm having trouble figuring out to do a one-t

[nhusers] Re: Oracle Sequences and SQLite

2010-05-17 Thread Corey Coogan
ion is probably to switch to a better POID generator: > guid.comb is my favorite, though many people prefer hilo. > > > > On Mon, May 17, 2010 at 9:24 AM, Corey Coogan wrote: > > Hi gang, > >     I'm using Oracle 10g and I'm working on getting DBA's to m

[nhusers] Oracle Sequences and SQLite

2010-05-17 Thread Corey Coogan
Hi gang, I'm using Oracle 10g and I'm working on getting DBA's to move away from composite keys to surrogate keys. They have started the migration on a few tables for me, but I've since learned during development that the sequences are causing problems in SQLite. I typically use SQL Server a

[nhusers] Query Cache Issues - releasing cache locks?

2010-05-13 Thread Corey Coogan
I have enabled query caching to use the NHibernate.Caches.Prevalence.PrevalenceCacheProvider provider. This is running on IIS 7, WCF service. I have limited rights to what I can do, but I'm getting an exception about releasing cache locks. I've created the following 2 directories in the system32/

[nhusers] Re: Surrogate Key Justification - Need Review

2010-03-16 Thread Corey Coogan
: > >http://www.agiledata.org/essays/keys.html > > > 2010/3/16 Corey Coogan > > > I'm trying to get my client to implement surrogate keys on their legacy > >> database to make using an ORM more viable, among other reasons.  I drafted > >> a > >>

[nhusers] Surrogate Key Justification - Need Review

2010-03-16 Thread Corey Coogan
I'm trying to get my client to implement surrogate keys on their legacy database to make using an ORM more viable, among other reasons. I drafted a quick document discussing the points and weighing surrogate keys against natural keys. I'm hoping to get some feedback and comments on what's miss

[nhusers] Help with Collection Mapping

2010-03-12 Thread Corey Coogan
I'm hoping someone can help me with mapping a legacy database. The problem I'm describing here has plagued others, yet I was unable to find a real good solution around the web. DISCLAIMER: this is a legacy DB. I have no control over the composite keys. They suck and can't be changed no matter m

[nhusers] Re: Collection Mapping Help

2010-03-01 Thread Corey Coogan
I think I've very close, but unfortunately not there yet. I made the changes suggested by Diego but I'm still getting the Index Out of Range exception. I don't have a version column, but am fighting for one. Could that be what's causing the issue? On Feb 25, 7:11 pm,

[nhusers] Re: Collection Mapping Help

2010-02-25 Thread Corey Coogan
. > >>>> I recreated your object model (which you didn't post) as this: > > >>>> public class Policy > >>>>  { > >>>> public virtual int PolicyNumber { get; set; } > >>>> public virtual DateTime PolicyDate { get; set; } > >>>>  public virtual IList Details { get; set; } > >>>> } > > >>>>  public class PolicyDetail > >>>> { > >&

[nhusers] Re: Collection Mapping Help

2010-02-25 Thread Corey Coogan
e?  I > think the solution is more likely to be a tweak on that end, not the bag > end. > > On Thu, Feb 25, 2010 at 1:43 PM, Corey Coogan wrote: > > Thanks for the feedback Anne.  My first post is correct, it is one to > > many - One Policy to Many PolicyDetails. > >

[nhusers] Re: Collection Mapping Help

2010-02-25 Thread Corey Coogan
ence as part of the primary key of the inbetween > table? If so I'd map the inbetween table as a separate 3 part entity with > many to one on either side. > > On Feb 25, 2010 12:52 PM, "Corey Coogan" wrote: > > Thanks John, >   this isn't quite what I need.  I&#

[nhusers] Re: Collection Mapping Help

2010-02-25 Thread Corey Coogan
This link help me when I was dealing with composite keys > > http://devlicio.us/blogs/anne_epstein/archive/2009/11/20/nhibernate-a... > > If you need more let us know. > > John Davidson > > On Thu, Feb 25, 2010 at 11:38 AM, Corey Coogan wrote: > > I have a root object, Polic

[nhusers] Collection Mapping Help

2010-02-25 Thread Corey Coogan
I have a root object, Policy, that has a compositeKey of PolicyNumber/ PolicyDate. The Policy has a one-to-many collection of PolicyDetails which have a composite key of PolicyNumber/PolicyDate/Sequence. Sequence is an assigned value that is set by the application. My Mapping for Policy is below

[nhusers] one-to-many Diffs between SQLITE and Oracle = Problems

2010-02-03 Thread Corey Coogan
I a one-to-many mapping that works in sql lite, but then blows up in Oracle. If I make a slight change, it will work in Oracle, but not in SQLITE. Here's my mappings: This works in SQL Lite In Oracle, it adds CLient to the select, as if it were a column. It throws an invalid identifier excep

[nhusers] Re: NamedQuery (sql-query) problems from one-to-many Mapping

2010-02-01 Thread Corey Coogan
I figured this out finally. I didn't specify my named query should populate a collection. It was also VERY important to fully qualify my class in the Role definition. Here's what my working named query looks like now. On Jan 29, 4:01 pm, Corey Coogan wrote: > I

[nhusers] NamedQuery (sql-query) problems from one-to-many Mapping

2010-01-29 Thread Corey Coogan
I'm beating my head against the wall here and hope to get some help from somebody - anybody. I have a goofy table relationship on a one- to-many mapping. I am trying to use a sql-query to define my query and reference it via loader element in my one-to-many relationship mapping. I've included th

[nhusers] composite-id and Mapped attribute - wtf?

2010-01-29 Thread Corey Coogan
I've searched books, doc and google for quite a while and cannot find what the Mapped attribute of the composite-id element does? When should this be set? Anybody know what this is for? Thanks, Corey -- You received this message because you are subscribed to the Google Groups "nhusers" group.

[nhusers] Re: Mapping Advice

2010-01-26 Thread Corey Coogan
I obviously didn't mean IUserType, just IUserCollectionType for collection. If there was an IUserType for entities as a whole, that would be perfect. Corey On Jan 26, 1:34 pm, Corey Coogan wrote: > I forgot to mention that I'm looking at using IUserType and > IUserCOllectionT

[nhusers] Re: Mapping Advice

2010-01-26 Thread Corey Coogan
I forgot to mention that I'm looking at using IUserType and IUserCOllectionType to make this work, but would still appreciate anyone's advice. cc On Jan 26, 12:35 pm, Corey Coogan wrote: > I'm working with a legacy system.  This system has 4 base tables in > Oracle and t

[nhusers] Mapping Advice

2010-01-26 Thread Corey Coogan
I'm working with a legacy system. This system has 4 base tables in Oracle and then will lay Views on top of these tables for specific use cases. Some of these base tables have over 100 views sitting on top of them. Each record in these base tables has an identifier (001, 002) that indicates whic

[nhusers] OneToMany with unmatching key columns

2010-01-26 Thread Corey Coogan
I posted this topic on the Fluent NH group and am looking how to accomplish this with a straight XML mapping. http://groups.google.com/group/fluent-nhibernate/browse_thread/thread/62e5f89c451cea85/d8dd0f42fdc6449e#d8dd0f42fdc6449e The situation is this. I have 2 tables, Policy and CrdtCrdAcct. A

[nhusers] IUserType and IUserCollectionType Quandary

2009-09-10 Thread Corey Coogan
I've been trying to figure this one out for a while now and am hoping someone can help me. I'm using Fluent NHibernate, but that doesn't affect my question. I am using a custom enumeration type, to get more than I would get out of an enum type. I created a base IUserType implementation that wor

[nhusers] Re: How to do Database Last in project?

2009-07-13 Thread Corey Coogan
gt; But when you use NHibernate you can just regenerate your db. > > On Jul 10, 3:40 pm, Corey Coogan wrote: > > > > > I've read about and heard some people talking about how they will > > create entire projects using NH and save the database generation until > >

[nhusers] How to do Database Last in project?

2009-07-10 Thread Corey Coogan
I've read about and heard some people talking about how they will create entire projects using NH and save the database generation until dead last. That sounds very interesting and can be done easily with the Schema Export, but I'm unclear how to actually accomplish this. Specifically, I'm confu