You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Help is available by sending an email to csf-support@mit.edu
Have any suggestion on how improve this wiki?  Please give us your feedback at csf-support@mit.edu

About Hibernate Mappings

The manner in which hibernate mappings are configured has changed from the manner in which hibernate mappings were configured in sais-common and in the CSF Version 1 series.  In sais-common and in CSF version 1, the sessionFactory's mappingResources property was used to configure hibernate mappings.  The use of the mappingResources property has been deprecated and will no longer be used except to support legacy applications.

With the release of the CSF version 2 series, the sessionFactory's mappingLocations property will be used to configure hibernate mappings.  The mappingLocations property allow for more flexibility when configuring hibernate mappings for several different sources.

The principal advantage of using the mappingLocations property is that you can specify a resource path to the mapping files as opposed to the absolute path to the mapping file.  This is all well and good but what does this actually mean.  In stead of specifying the hibernate mappings as shown below:

        <value>edu/mit/common/domain/academic/hibernate/AcademicTerm.hbm.xml</value>
        <value>edu/mit/common/domain/academic/hibernate/AcademicTermDate.hbm.xml</value>
        <value>edu/mit/common/domain/academic/hibernate/AcademicYear.hbm.xml</value>
        <value>edu/mit/common/domain/academic/hibernate/Department.hbm.xml</value>
        <value>edu/mit/common/domain/academic/hibernate/EnrollmentStatus.hbm.xml</value>
        <value>edu/mit/common/domain/academic/hibernate/Course.hbm.xml</value>
        <value>edu/mit/common/domain/academic/hibernate/Citizenship.hbm.xml</value>

Using the mappingLocations property, you can now specify the hibernate mapping as shown below:

        <value>edu/mit/common/domain/academic/hibernate/*.hbm.xml</value>
  • No labels