站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 2.1.8 正式版 API 英文文档

Databinder (Hibernate API Documentation) - Hibernate 2.1.8 正式版 API 英文文档


net.sf.hibernate
Interface Databinder

All Known Implementing Classes:
XMLDatabinder

public interface Databinder

Provides XML Marshalling for classes registered with a SessionFactory. Hibernate defines a generic XML format that may be used to represent any class (hibernate-generic.dtd). The user configures an XSLT stylesheet for marshalling data from this generic format to an application and / or user readable format. By default, Hibernate will use hibernate-default.xslt which maps data to a useful human - readable format.

The property hibernate.xml.output_stylesheet specifies a user - written stylesheet. Hiberate will attempt to load the stylesheet from the classpath first and if not found, it will attempt to load it as a file.

This is an experimental feature.

It is not intended that implementors be threadsafe.

Author:
Gavin King, Brad Clow
See Also:
SessionFactory

Method Summary
 Databinder bind(Object object)
          Add an object to the output document.
 Databinder bindAll(Collection objects)
          Add a collection of objects to the output document.
 void setInitializeLazy(boolean initializeLazy)
          Controls lazy initialization.
 org.w3c.dom.Document toDOM()
          Output the custom XML representation of the bound objects as a DOM tree.
 org.w3c.dom.Document toGenericDOM()
          Output the generic XML representation of the bound objects as a DOM tree.
 String toGenericXML()
          Output the generic XML representation of the bound objects.
 String toXML()
          Output the custom XML representation of the bound objects.
 

Method Detail

bind

public Databinder bind(Object object)
Add an object to the output document.

Parameters:
object - a transient or persistent instance
Returns:
Databinder

bindAll

public Databinder bindAll(Collection objects)
Add a collection of objects to the output document.

Parameters:
objects -
Returns:
Databinder

toGenericXML

public String toGenericXML()
                    throws HibernateException
Output the generic XML representation of the bound objects.

Returns:
String generic XML representation
Throws:
HibernateException

toGenericDOM

public org.w3c.dom.Document toGenericDOM()
                                  throws HibernateException
Output the generic XML representation of the bound objects as a DOM tree.

Returns:
Node generic XML tree
Throws:
HibernateException

toXML

public String toXML()
             throws HibernateException,
                    javax.xml.transform.TransformerException
Output the custom XML representation of the bound objects.

Returns:
String custom XML representation
Throws:
HibernateException
javax.xml.transform.TransformerException

toDOM

public org.w3c.dom.Document toDOM()
                           throws HibernateException,
                                  javax.xml.transform.TransformerException
Output the custom XML representation of the bound objects as a DOM tree.

Returns:
Node custom XML tree
Throws:
HibernateException
javax.xml.transform.TransformerException

setInitializeLazy

public void setInitializeLazy(boolean initializeLazy)
Controls lazy initialization. Controls whether bound objects (and their associated objects) that are lazily initialized are explicitly initialized or left as they are.

Parameters:
initializeLazy - true to explicitly initialize lazy objects, false to leave them in the state they are in.