I meant implementing IUserType.You can have a thing like

class MyBinary
{
   byte[] Data{get;set}
   bool Changed{get;set;}
}

class MyBinaryType:IUserType//This is the type that NH will use, above is
its representation in the domain
{

}

Can't speak from the mind, without looking the code.

Tuna Toksöz
Eternal sunshine of the open source mind.

http://devlicio.us/blogs/tuna_toksoz
http://tunatoksoz.com
http://twitter.com/tehlike




On Thu, Jul 23, 2009 at 10:09 PM, jc_lvngstn <[email protected]>wrote:

>
> Seems like the easiest thing would be to have the ability to control
> when the dirty flag is set. For example, in the setter of my binary
> object, I could just set isdirty was true, and have nHibernate just
> check my own bool dirty flag.
>
> Otherwise...I'm not sure what you mean by user type. Are you saying I
> should do something like this:
>
> Thing
> {
>  public virtual Id {get;set;}
>   public virtual MyCustomBinaryData {get;set;}
> }
>
> class MyCustomBinaryData
> {
>  byte[] Date {get;set;}
> }
>
> thanks for your help with this!
>
> On Jul 23, 11:50 am, Tuna Toksoz <[email protected]> wrote:
> > I know the problem: The dirty check. It has to loop all individual bytes.
> A
> > work around would be to use your own type.
> >
> > Tuna Toksöz
> > Eternal sunshine of the open source mind.
> >
> >
> http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitter.com/tehlike
> >
> > On Thu, Jul 23, 2009 at 7:29 PM, jc_lvngstn <[email protected]
> >wrote:
> >
> >
> >
> > > I have a situation where updateing/inserting a binary object of about
> > > 300k in a sql database takes so long (20+ minutes) that I have to end
> > > the program. Loading the data is fairly quick, however.
> > > My classes look like this:
> >
> > > Parent
> > > {
> > >   public virtual Guid Id {get;set;}
> > >   Thing {get;set;}
> > > }
> >
> > > Thing {
> > >  public virtual Id {get;set;}
> > >  public virtual byte[] Data {get;set;}
> > > }
> >
> > > Parent.hbm.xml:
> > > Here is the xml where I declare Thing property information for Parent
> >
> > >    <many-to-one name="Thing"
> > >                 class="Thing"
> > >                 column="ThingId"
> > >                 cascade="save-update"
> > >                 lazy="proxy" />
> >
> > > In the SQL database, the Parent table contains a ThingId column with a
> > > guid that references the Id of that particular Thing in the Thing
> > > table, so it's really a one-to-one mapping.
> >
> > > I'm somewhat new to nHibernate, any suggestions would be very
> > > welcome.
> >
> > > Thing.hbm.xml looks like this (without the header portion)
> >
> > > <class name="Thing"
> > >         lazy="true">
> > >    <id name="Id">
> > >      <generator class="guid" />
> > >    </id>
> > >    <property name="Data" column="Data" type="BinaryBlob"
> > > length="2147483647" />
> > >  </class>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to