Hilo

3 views
Skip to first unread message

cws

unread,
Apr 22, 2009, 9:05:16 AM4/22/09
to nhusers
Hi!

I have 3 questions about hilo.

I can specify for each table which uses hilo where it should fetch
next_hi.
Say I have table A and table B.

Question 1:
Can I then do following?

For table A
<generator class="hilo">
<param name="table">hi_value</param>
<param name="column">next_value_A</param>
</generator>

For table B
<generator class="hilo">
<param name="table">hi_value</param>
<param name="column">next_value_B</param>
</generator>

Question 2:
Can I set int's minvalue -2^31 as intial value in the columns to use
integers32 whole space? Would I then need to have int's minvalue as
unsaved value in those mappings.

Question 3:
What is the default max_lo?

Regards

Fabio Maulo

unread,
Apr 22, 2009, 9:12:53 AM4/22/09
to nhu...@googlegroups.com


2009/4/22 cws <cw.st...@gmail.com>


Hi!

I have 3 questions about hilo.

I can specify for each table which uses hilo where it should fetch
next_hi.
Say I have table A and table B.

Question 1:
Can I then do following?

For table A
<generator class="hilo">
 <param name="table">hi_value</param>
 <param name="column">next_value_A</param>
</generator>

For table B
<generator class="hilo">
 <param name="table">hi_value</param>
 <param name="column">next_value_B</param>
</generator>

Yes.
 


Question 2:
Can I set int's minvalue -2^31 as intial value in the columns to use
integers32 whole space? Would I then need to have int's minvalue as
unsaved value in those mappings.

You can but it is unnecessary.



Question 3:
What is the default max_lo?

Int16.MaxValue

--
Fabio Maulo

cws

unread,
Apr 22, 2009, 10:46:12 AM4/22/09
to nhusers
Hi! Thank you for answers

> > Question 3:
> > What is the default max_lo?
>
> Int16.MaxValue

So in an Asp.Net environment I guess you would set it to maybe 100
depending an activity?

Regards


On 22 Apr, 15:12, Fabio Maulo <fabioma...@gmail.com> wrote:
> 2009/4/22 cws <cw.stenb...@gmail.com>

Fabio Maulo

unread,
Apr 22, 2009, 11:08:28 AM4/22/09
to nhu...@googlegroups.com
2009/4/22 cws <cw.st...@gmail.com>


Hi! Thank you for answers

> > Question 3:
> > What is the default max_lo?
>
> Int16.MaxValue

So in an Asp.Net environment I guess you would set it to maybe 100
depending an activity?

It depend on various things, btw 100 is a good number.

--
Fabio Maulo

cws

unread,
Apr 23, 2009, 10:23:08 AM4/23/09
to nhusers
Hello!

Another question about Hilo and Id-generators continuing my
exploration of the hilo id-generator.

If I have a m-m-table with following:

<class name="BlockKurskatalog" table="Block_Kurskatalog" >
<id name="ID" >
<generator class="hilo"/>
</id>
<property name="BlockId" not-null="true" unique-
key="IX_Block_Kurskatalog"/>
<property name="KurskatalogId" not-null="true" unique-
key="IX_Block_Kurskatalog"/>
<many-to-one name="Block" />
<many-to-one name="Kurskatalog"/>
</class>

and mapping making use of m-m-table

<class name="Kurskatalog" table="Kurskatalog" dynamic-insert="true"
dynamic-update="true" >
<id name="ID" column="Id">
<generator class="hilo"/>
</id>
<idbag name="Blocks" table="Block_Kurskatalog" cascade="all">
<collection-id column="collection_index" type="Int32">
<generator class="hilo"/>
</collection-id>
<key column="Kurskatalog_id" />
<many-to-many class="Block" column="Block_id" />
</idbag>
</class>

Then I have the flexibility to work against the object mapped to m-m-
table directly and through the object with mapping making us of m-m-
table. The second option is the preferred.

Would those two id-generators cause each other any problems?


On 22 Apr, 17:08, Fabio Maulo <fabioma...@gmail.com> wrote:
> 2009/4/22 cws <cw.stenb...@gmail.com>
>
>
>
Reply all
Reply to author
Forward
0 new messages