From version < 5.3 >
edited by Denis Gervalle
on 2012/09/11
To version < 5.4 >
edited by Manuel Smeria
on 2013/01/24
< >
Change comment: minor fixes

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.dgervalle
1 +XWiki.ManuelSmeria
Content
... ... @@ -1,6 +1,7 @@
1 1  Custom Mappings allows to map a XWiki Class (XClass) to its own database table (as opposed to XClasses that are not mapped and that use the standard, predefined, XWiki table scheme). Custom mapping can be useful for improving performances (when expecting a class to have a large number of instances for example), or for sharing external data (enterprise data, or other software data for example) with XWiki.
2 2  
3 3  Making use of custom mapping is a 3 step process:
4 +
4 4  1. Define the actual Hibernate mapping for your XClass, in a ##hbm.xml## file (see the example below). This file should then be made available somewhere in the CLASSPATH (##WEB-INF/classes## or in your own JAR file that you put in ##WEB-INF/lib##).(((
5 5  
6 6  Example Mapping file (##mailinglist.hbm.xml##):
... ... @@ -57,4 +57,6 @@
57 57  
58 58  Once these 3 steps have been done, loading and saving of your XClass will go in the table you've defined in your custom Hibernate mapping file.
59 59  
60 -{{info}}Since XWiki 3.5.2, 4.1.4, and 4.2M3, copying a document containing a custom mapped class does not make the copied class custom mapped anymore. This has been introduced to avoid the newly created class to be unusable and inconsistent with the available mapping.{{/info}}
61 +{{info}}
62 +Since XWiki 3.5.2, 4.1.4, and 4.2M3, copying a document containing a custom mapped class does not make the copied class custom mapped anymore. This has been introduced to avoid the newly created class to be unusable and inconsistent with the available mapping.
63 +{{/info}}

Get Connected