[nhusers] Re: UserType and Lifestyle

2009-02-05 Thread Tim Barcz
of string or MyAccount class... >> >> Gustavo. >> >> >> On Thu, Feb 5, 2009 at 12:48 AM, Tim Barcz wrote: >> >>> No following. >>> >>> >>> On Wed, Feb 4, 2009 at 4:13 PM, Fabio Maulo wrote: >>> >>>> Use

[nhusers] Re: UserType and Lifestyle

2009-02-04 Thread Tim Barcz
No following. On Wed, Feb 4, 2009 at 4:13 PM, Fabio Maulo wrote: > UserType << look at "Type" word. > > 2009/2/4 Tim Barcz > >> >> > type="MyAssembly.Data.MoneyUserType, MyAssembly.Data" /> >> ... >> >> What is the

[nhusers] UserType and Lifestyle

2009-02-04 Thread Tim Barcz
... What is the lifestyle of the IUserType (MoneyUserType) here? Singleton? Transient? Other? Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhusers

[nhusers] Re: Proper session usage

2009-01-14 Thread Tim Barcz
t manages this. > > On Jan 14, 10:07 am, "Tim Barcz" wrote: > > "Per Conversatation" -> web app or windows? > > > > Tim > > > > > > > > On Wed, Jan 14, 2009 at 7:25 AM, epitka wrote: > > > > > I actually use sessi

[nhusers] Re: Mapping one-to-one entities

2009-01-14 Thread Tim Barcz
> -- > > Wolfgang > > > > *From:* nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] *On > Behalf Of *Tim Barcz > *Sent:* Dienstag, 13. Januar 2009 18:06 > *To:* nhusers@googlegroups.com > *Subject:* [nhusers] Re: Mapping one-to-one entities > > > &g

[nhusers] Re: Proper session usage

2009-01-14 Thread Tim Barcz
sample just wants to point > out > > that one should always use transactions when accessing the database > (write *and > > *read operations). *How *you do it depends on the type of application you > > implement. > > > > > > > > On Tue, Jan 13, 2009 a

[nhusers] Re: Proper session usage

2009-01-14 Thread Tim Barcz
*you do it depends on the type of application > you implement. > > On Tue, Jan 13, 2009 at 5:56 PM, Tim Barcz wrote: > >> I'm seeing recommendations from NHProf/Ayende to do the following: >> >> using(var session = sessionFactory.OpenSession()) >>

[nhusers] Re: Mapping one-to-one entities

2009-01-13 Thread Tim Barcz
Can you explain why one to one is not advised? We use one-to-one in a non-legacy system, generally for items which are optional. The other way we could do this would be to represent the object as a many to many, which now structures the data in a way that is inconsistent with how we use the data.

[nhusers] Re: Proper session usage

2009-01-13 Thread Tim Barcz
gt; > On Tue, Jan 13, 2009 at 4:56 PM, Tim Barcz wrote: > >> I'm seeing recommendations from NHProf/Ayende to do the following: >> >> using(var session = sessionFactory.OpenSession()) >> using(var tx = session.BeginTransaction()) >> >> { >

[nhusers] Proper session usage

2009-01-13 Thread Tim Barcz
I'm seeing recommendations from NHProf/Ayende to do the following: using(var session = sessionFactory.OpenSession()) using(var tx = session.BeginTransaction()) { var post = session.Get(1); // do something with post tx.Commit(); } The issue with this is that it does not all

[nhusers] Entity Equality

2008-12-15 Thread Tim Barcz
I am reading through a book on NHibernate (NHIbernate in Action, Manning) and when talking about comparing entity values based on database identifier (which is what EntityBase does) it strongly discourages equality based on database Id's: Unfortunately, this solution has one huge problem: NHiberna

[nhusers] Re: Best Practice: property access

2008-11-15 Thread Tim Barcz
What about scenarios where a property performs some calculation. Imagine an "Order" object and OrderTotal is a property so that it can be persisted. Yet OrderTotal looks something like: public Money OrderTotal { get{ return ProductTotal + ShippingTotal + HandlingFee + Tax; } } I

[nhusers] Re: Lazy Loading but from a different place

2008-10-24 Thread Tim Barcz
Listener is the way to go I'd like to dig into that, just not finding much at this point. Tim On Thu, Oct 23, 2008 at 4:30 PM, Tim Barcz <[EMAIL PROTECTED]> wrote: > Please explain > > > On Thu, Oct 23, 2008 at 3:25 PM, Fabio Maulo <[EMAIL

[nhusers] Re: Lazy Loading but from a different place

2008-10-23 Thread Tim Barcz
name (stored in the primary db). >> >> >> On Oct 23, 2:58 pm, "Tim Barcz" <[EMAIL PROTECTED]> wrote: >> > Willwe don't have product information in the database at all, it's >> > stored in another database (not SQL). >> > >&

[nhusers] Re: Lazy Loading but from a different place

2008-10-23 Thread Tim Barcz
d this successfully to merge a database I could write to with > one I could not. > > You can map hbm files to views, just specify the view name as the "table". > > > > > On Thu, Oct 23, 2008 at 11:41 AM, Tim Barcz <[EMAIL PROTECTED]> wrote: > > We have t

[nhusers] Lazy Loading but from a different place

2008-10-23 Thread Tim Barcz
We have two databases, a SQL server database and another proprietary database for storing our products in. We want to store order information in the database. In the object world, the Order has OrderItems. OrderItem is composed of a Product and a Quantity. The problem is the Product information

[nhusers] Re: Uni or Bi

2008-10-21 Thread Tim Barcz
enough matter to go > newPlayer.Game = this; and the two way relationship is intact. > > On Oct 21, 7:06 pm, "Tim Barcz" <[EMAIL PROTECTED]> wrote: > > Thanks for the input, that's exactly what I'm bumping into now. I > presume > > then you make it bidir

[nhusers] Re: Uni or Bi

2008-10-21 Thread Tim Barcz
before you save and reload the changes using > > NHibernate - the association in memory is not automatically handled so > the > > Order instance's OrderLines collection will not contain the new OrderLine > > unless you explicitly add it yourself in your code. > > > &g

[nhusers] Re: Point me in the right direction.

2008-10-21 Thread Tim Barcz
ist to have a user property, because it is in its own table. > When you have a one to many association, by definition it is not on the > same table, so it goes as a separate statement. > > If you don't want bidi, then you uni on the many to one side seems natural. > > &g

[nhusers] Re: Point me in the right direction.

2008-10-21 Thread Tim Barcz
r. This means that you usually have the uni directional from that, and > query from the user if you need to. > That is a good idea anyway, since that means that you start thinking about > things like unbounded result sets. > > > On Tue, Oct 21, 2008 at 5:54 PM, Tim Barcz <[EMAIL

[nhusers] Re: Point me in the right direction.

2008-10-21 Thread Tim Barcz
ide the table name of the > children (that is the WishList items) in the mapping... > And about DDD: in the DDD book of Evans he states that uni-directional > relations are preferable. That does not mean that under certain > circumstances there shouldn't be a bi-directional relat

[nhusers] Re: Point me in the right direction.

2008-10-21 Thread Tim Barcz
ay this is acceptable in NH then I am fine with it. No complaints here. On Tue, Oct 21, 2008 at 12:01 PM, Ayende Rahien <[EMAIL PROTECTED]> wrote: > Tim, > That is a limitation of SQL, not NH. > > > On Tue, Oct 21, 2008 at 6:58 PM, Tim Barcz <[EMAIL PROTECTED]> w

[nhusers] Re: Point me in the right direction.

2008-10-21 Thread Tim Barcz
Setttling on the following: Unidirectional mapping cannot complete with two statements...must be threeand have to have a nullable foreign-key field On Tue, Oct 21, 2008 at 11:36 AM, Tim Barcz <[EMAIL PROTECTED]> wrote: > But then it's bidirectionalI have it bidirectional r

[nhusers] Uni or Bi

2008-10-21 Thread Tim Barcz
I'm hearing and reading different thingsis unidirectional or bidirectional the recommended way. On certain scenarios I don't need to go unidirectional but then have a hard time mapping but then see people say unidirectional is bad. Which is it? Uni or Bi? --~--~-~--~~---

[nhusers] Re: Point me in the right direction.

2008-10-21 Thread Tim Barcz
u would get what you expect. > > > On Tue, Oct 21, 2008 at 6:24 PM, Tim Barcz <[EMAIL PROTECTED]> wrote: > >> Tried putting the table in the user mapping (see below)...however that >> resulted in three calls being made (and I have to have a nullable foreign >> key) >

[nhusers] Re: Point me in the right direction.

2008-10-21 Thread Tim Barcz
ys "it > depends" > > > On Tue, Oct 21, 2008 at 6:04 PM, Tim Barcz <[EMAIL PROTECTED]> wrote: > >> I can make this work if this bidirectionalhowever I'm needing some >> guidance as to whether things should be bidirectional or not. Seems like >

[nhusers] Re: Point me in the right direction.

2008-10-21 Thread Tim Barcz
I can make this work if this bidirectionalhowever I'm needing some guidance as to whether things should be bidirectional or not. Seems like the domain should dictate, however am not seeing it so simply. On Tue, Oct 21, 2008 at 10:57 AM, Tim Barcz <[EMAIL PROTECTED]> wrote: >

[nhusers] Re: Point me in the right direction.

2008-10-21 Thread Tim Barcz
;, @p1 = 'Barcz' NHibernate: INSERT INTO WishLists (Name, UserId) VALUES (@p0, @p1); select SCOPE_IDENTITY(); @p0 = 'Sample', @p1 = '' On Tue, Oct 21, 2008 at 10:47 AM, Ayende Rahien <[EMAIL PROTECTED]> wrote: > You need to specify inverse=true > > &g

[nhusers] Re: Point me in the right direction.

2008-10-21 Thread Tim Barcz
ct 21, 2008 at 10:46 AM, Gabriel Schenker <[EMAIL PROTECTED]>wrote: > show your mappings please > > > On Tue, Oct 21, 2008 at 5:44 PM, Tim Barcz <[EMAIL PROTECTED]> wrote: > >> Ok that's well and good...so I've got unidirectional going onbut am >>

[nhusers] Re: Point me in the right direction.

2008-10-21 Thread Tim Barcz
ectional) that is, a wishlist does not have to know any thing about a > user or about its manager > > > On Mon, Oct 20, 2008 at 11:16 PM, Tim Barcz <[EMAIL PROTECTED]> wrote: > >> I have a user object and the user can have a number of wishlists. >> >> Instead o

[nhusers] Point me in the right direction.

2008-10-20 Thread Tim Barcz
I have a user object and the user can have a number of wishlists. Instead of having methods on user (ie. User.AddWishlist, User.RemoveWishlist), I have a WishListManager which has these methods on it. Persistent entities include, WishList and WishList item, which relate back to the user through t

[nhusers] Re: Mapping Assistance

2008-10-16 Thread Tim Barcz
oute. Tim On Thu, Oct 16, 2008 at 12:48 AM, Ayende Rahien <[EMAIL PROTECTED]> wrote: > Did you solve the issue? > > > On Thu, Oct 16, 2008 at 1:39 AM, Tim Barcz <[EMAIL PROTECTED]> wrote: > >> Ok I understand where the circularity is now...just don't understan

[nhusers] Re: Mapping Assistance

2008-10-15 Thread Tim Barcz
he user.The workflow I outlined before > should work. > > > On Thu, Oct 16, 2008 at 12:01 AM, Tim Barcz <[EMAIL PROTECTED]> wrote: > >> So how do I break that, where'd I go wrong? >> >> >> On Wed, Oct 15, 2008 at 5:00 PM, Ayende Rahien <[EMAIL PROTECTE

[nhusers] Re: Mapping Assistance

2008-10-15 Thread Tim Barcz
Rahien <[EMAIL PROTECTED]> wrote: > You didn't do wrong, you need to save the user without the address, then > save the address, then update the user.The workflow I outlined before > should work. > > > On Thu, Oct 16, 2008 at 12:01 AM, Tim Barcz <[EMAIL PROTECTED]> wro

[nhusers] Re: Mapping Assistance

2008-10-15 Thread Tim Barcz
So how do I break that, where'd I go wrong? On Wed, Oct 15, 2008 at 5:00 PM, Ayende Rahien <[EMAIL PROTECTED]> wrote: > The problem is that you are trying to save the user which has a reference > to the address, which reference the user. > > > On Wed, Oct 15, 2008 at 1

[nhusers] Re: Mapping Assistance

2008-10-15 Thread Tim Barcz
te user) > > > On Wed, Oct 15, 2008 at 11:50 PM, Tim Barcz <[EMAIL PROTECTED]> wrote: > >> Here is what I have >> >> >> >> >> >> >> > /> >> >> >

[nhusers] Re: Mapping Assistance

2008-10-15 Thread Tim Barcz
t; > > On Wed, Oct 15, 2008 at 11:44 PM, Tim Barcz <[EMAIL PROTECTED]> wrote: > >> What we want to do seems fairly trivial but am bumping into my limited >> knowledge with NH. >> >> We have a user (in the context of an eCommerce site). This user can have >

[nhusers] Re: Mapping Assistance

2008-10-15 Thread Tim Barcz
wrote: > > > > >... > > > > > > On Wed, Oct 15, 2008 at 11:44 PM, Tim Barcz <[EMAIL PROTECTED]> wrote: > >> What we want to do seems fairly trivial but am bumping into my limited >> knowledge with NH. >> >> We have a user (in the context of an eCommerce si

[nhusers] Re: Mapping Assistance

2008-10-15 Thread Tim Barcz
Is it truly one to one, if the billing address and shipping address could be the same address/entity? On Wed, Oct 15, 2008 at 4:46 PM, Tuna Toksöz <[EMAIL PROTECTED]> wrote: > one to one in relations in book, probably. > > > On Thu, Oct 16, 2008 at 12:44 AM, Tim Barcz <[EM

[nhusers] Mapping Assistance

2008-10-15 Thread Tim Barcz
What we want to do seems fairly trivial but am bumping into my limited knowledge with NH. We have a user (in the context of an eCommerce site). This user can have a number of addresses (think an address book). For convenience the user can also have a default addressId. I have two tables...User

[nhusers] Re: InvalidCastException

2008-09-30 Thread Tim Barcz
Props to you all who are on the NH team. My question was definitely newbie-ish, however being new I am not always sure where or what to look for. As I hit tough spots it's nice to see you guys have paved the way. Very nice and thank you. Tim On Tue, Sep 30, 2008 at 1:48 PM, Tim Barcz &l

[nhusers] Re: InvalidCastException

2008-09-30 Thread Tim Barcz
Thanks Oren... still getting used to where to find stuff for NH... On Tue, Sep 30, 2008 at 1:45 PM, Ayende Rahien <[EMAIL PROTECTED]> wrote: > You need to use IUserType > > > On Tue, Sep 30, 2008 at 9:13 PM, Tim Barcz <[EMAIL PROTECTED]> wrote: > >> >>

[nhusers] InvalidCastException

2008-09-30 Thread Tim Barcz
Am getting an InvalidCastException when trying to load data from database. We have a class "Money" which is used for obvious purposes. In the database it is stored as a decimal. To handle the conversions in code we simply use an implicit operator, however NH is having trouble creating a Money o