Java Reference
In-Depth Information
Attribute
Values
Default
Description
optimistic-lock
none , version
version
Specifies the optimistic locking dirty ,
all strategy to use. The strategy applies
at a class level, but in Hibernate 3 can
also be specified (or overridden) at an
attribute level. Optimistic locking is dis-
cussed in Appendix A.
persister
Allows a custom ClassPersister object
to be used when persisting the entity.
polymorphism
implicit , explicit
implicit
Determines how polymorphism is to be
used. The default implicit behavior will
return instances of the class if super-
classes or implemented interfaces are
named in the query, and will return
subclasses if the class itself is named in
the query.
proxy
Specifies a class or an interface to use as
the proxy for lazy initialization. Hiber-
nate uses runtime-generated proxies by
default, but you can specify your own
implementation of org.hibernate.
HibernateProxy in their place.
rowid
Flags that row IDs should be used (a
database-implementation detail allow-
ing Hibernate to optimize updates).
schema
Optionally overrides the schema speci-
fied by the <hibernate-mapping> element.
select-before-
true , false
false
Flags that Hibernate should carry out
update
extra work to avoid issuing unnecessary
UPDATE statements. If set to true , Hiber-
nate issues a SELECT statement before
attempting to issue an UPDATE statement
in order to ensure that the UPDATE state-
ment is actually required (i.e., that col-
umns have been modified). While this is
likely to be less efficient, it can prevent
database triggers from being invoked
unnecessarily.
subselect
A subselection of the contents of the
underlying table. A class can only use
a subselect if it is immutable and read-
only (because the SQL defined here can-
not be reversed). Generally, the use of a
database view is preferable.
table
The table name associated with the class
(if unspecified, the unqualified class
name will be used).
where
An arbitrary SQL where condition to be
used when retrieving objects of this class
from the table.
Many of these attributes in the <class> element are designed to support preexisting data-
base schemas. In practice, the name attribute is very often the only one set.
Search WWH ::




Custom Search