|
3353 | 3353 | example, for audit logs, user session data, etc.
|
3354 | 3354 | </para>
|
3355 | 3355 |
|
3356 |
| - <programlisting><![CDATA[<any name="AnyEntity" id-type="Int64" meta-type="Eg.Custom.Class2TablenameType"> |
3357 |
| - <column name="table_name"/> |
| 3356 | + <programlisting><![CDATA[<any name="AnyEntity" id-type="long" meta-type="class"> |
| 3357 | + <column name="type"/> |
3358 | 3358 | <column name="id"/>
|
3359 | 3359 | </any>]]></programlisting>
|
3360 | 3360 |
|
3361 | 3361 | <para>
|
3362 | 3362 | The <literal>meta-type</literal> attribute allows the application to specify a custom type that maps
|
3363 | 3363 | database column values to persistent classes that have identifier properties of the type specified by
|
3364 |
| - <literal>id-type</literal>. If the meta-type returns instances of <literal>System.Type</literal>, |
3365 |
| - nothing else is required. On the other hand, if it is a basic type like <literal>String</literal> or |
3366 |
| - <literal>Char</literal>, you must specify the mapping from values to classes. |
| 3364 | + <literal>id-type</literal>. If the meta-type is <literal>class</literal>, nothing else is required. |
| 3365 | + The class full name will be persisted in the database as the type of the associated entity. |
| 3366 | + On the other hand, if it is a basic type like <literal>string</literal> or |
| 3367 | + <literal>char</literal>, you must specify the mapping from values to classes. |
3367 | 3368 | </para>
|
3368 | 3369 |
|
3369 | 3370 | <programlisting><![CDATA[<any name="being" id-type="long" meta-type="string">
|
3370 |
| - <meta-value value="TBL_ANIMAL" class="Animal"/> |
3371 |
| - <meta-value value="TBL_HUMAN" class="Human"/> |
3372 |
| - <meta-value value="TBL_ALIEN" class="Alien"/> |
3373 |
| - <column name="table_name"/> |
| 3371 | + <meta-value value="ANIMAL_TYPE" class="Animal"/> |
| 3372 | + <meta-value value="HUMAN_TYPE" class="Human"/> |
| 3373 | + <meta-value value="ALIEN_TYPE" class="Alien"/> |
| 3374 | + <column name="type"/> |
3374 | 3375 | <column name="id"/>
|
3375 | 3376 | </any>]]></programlisting>
|
3376 | 3377 |
|
|
3419 | 3420 | </callout>
|
3420 | 3421 | <callout arearefs="any3">
|
3421 | 3422 | <para>
|
3422 |
| - <literal>meta-type</literal> (optional - defaults to <literal>Type</literal>): a type that |
3423 |
| - maps <literal>System.Type</literal> to a single database column or, alternatively, a type |
3424 |
| - that is allowed for a discriminator mapping. |
| 3423 | + <literal>meta-type</literal> (optional - defaults to <literal>string</literal>): a type |
| 3424 | + that is allowed for a discriminator mapping, or <literal>class</literal>. |
3425 | 3425 | </para>
|
3426 | 3426 | </callout>
|
3427 | 3427 | <callout arearefs="any4">
|
|
0 commit comments