142 CHAPTER 7 n CREATING MAPPINGS WITH HIBERNATE XML FILES CHAPTER 7 n CREATING MAPPINGS WITH HIBERNATE XML FILES Table 7-2. The Attributes Attribute Values Default Description auto-import true, false true By default, allows you to use the unqualified class names in Hibernate queries. You would normally only set this to false if the class name would otherwise be ambiguous. catalog The database catalog against which queries should apply. default-access property The default access type. If set to property, then get and set methods are used to access the data. If set to field, then the data is accessed directly. Alternatively, you can provide the class name of a PropertyAccessor implementation defining any other access mechanism. default-cascade Defines how (and whether) direct changes to data should affect dependent data by default. default-lazy true, false true Defines whether lazy instantiation is used by default. Generally, the performance benefits are such that you will want to use lazy instantiation whenever possible. package The package from which all implicit imports are considered to occur. schema The database schema against which queries should apply. The default cascade modes available for the default-cascade attribute (and for the cascade attributes in all other elements) are as follows: create, merge, delete, save-update, evict, replicate, lock, refresh These correspond to the various possible changes in the lifestyle of the parent object. When set (you can include combinations of them as comma-separated values), the relevant changes to the parent will be cascaded to the relation. For example, you may want to apply the save-update cascade option to a class that includes Set attributes, so that when new persistent classes are added to these, they will not have to be saved explicitly in the session. There are also three special options: all, delete-orphan, none allspecifies that all changes to the parent should be propagated to the relation, and none specifies that none should. delete-orphanapplies only to one-to-many associations, and specifies that the relation should be deleted when it is no longer referenced by the parent. The required order and cardinality of the child elements of are as follows: (meta*, typedef*, import*, (class | subclass | joined-subclass | union-subclass)*, (query | sql-query)*, filter-def*)
Note: In case you are looking for affordable webhost to host and run your web application check Vision http web server services
This entry was posted
on Monday, May 7th, 2007 at 3:05 am and is filed under tomcat.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.