Refactor Java Classes and Fields

A Hibernate mapping maps a Java class and its fields to a database table and its columns. In NetBeans, the Hibernate mapping files will be refactored when any of the referenced Java classes or Java properties/fields are refactored (class/package/field renamed, class moved into a different package). In detail, the following element/attributes in the Hibernate mapping file might be affected by the refactoring:

Element Attributes
<hibernate-mapping> package
<class> name
<subclass> name
<joined-subclass> name
<union-subclassclass> name
<id> name
<composite-id> name, class
<key-property> name
<key-many-to-one> name, class
<version> name
<timestamp> name
<property> name
<many-to-one> name, class
<one-to-one> name, class
<component> name, class
<subclass> name, extends
<joined-subclass> name, extends, persister
<union-subclass> name, extends, persister
<column> name
<import> class
<any> name
<map> name
<list> name
<many-to-many> class
<one-to-many> class

Refactoring Hiberante Mapping Files (NOT SUPPORTED in NetBeans 6.1, yet)

The Hibernate mapping files can be referenced in the Hibernate configuration files in the <mapping resource=""> attribute. When a Hibernate mapping file is refactored to a different name (rename) or move to a different package, the corresponding <mapping> elements in the configuration files will be refactored properly.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo