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

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


net.sf.hibernate.cfg
Class Mappings

java.lang.Object
  extended bynet.sf.hibernate.cfg.Mappings

public class Mappings
extends Object

A collection of mappings from classes and collections to relational database tables. (Represents a single <hibernate-mapping> element.)

Author:
Gavin King

Method Summary
 void addCache(String name, CacheConcurrencyStrategy cache)
           
 void addClass(PersistentClass persistentClass)
           
 void addCollection(Collection collection)
           
 void addImport(String className, String rename)
           
 void addQuery(String name, String query)
           
 void addSQLQuery(String name, NamedSQLQuery query)
           
 Table addTable(String schema, String name)
           
 PersistentClass getClass(Class clazz)
           
 Collection getCollection(String role)
           
 String getDefaultAccess()
           
 String getDefaultCascade()
           
 String getDefaultPackage()
           
 NamingStrategy getNamingStrategy()
           
 String getQuery(String name)
           
 String getSchemaName()
           
 Table getTable(String schema, String name)
           
 boolean isAutoImport()
          Returns the autoImport.
 void setAutoImport(boolean autoImport)
          Sets the autoImport.
 void setDefaultAccess(String defaultAccess)
          sets the default access strategy
 void setDefaultCascade(String defaultCascade)
          Sets the defaultCascade.
 void setDefaultPackage(String defaultPackage)
           
 void setSchemaName(String schemaName)
          Sets the schemaName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addClass

public void addClass(PersistentClass persistentClass)
              throws MappingException
Throws:
MappingException

addCollection

public void addCollection(Collection collection)
                   throws MappingException
Throws:
MappingException

getClass

public PersistentClass getClass(Class clazz)

getCollection

public Collection getCollection(String role)

addImport

public void addImport(String className,
                      String rename)
               throws MappingException
Throws:
MappingException

addTable

public Table addTable(String schema,
                      String name)

getTable

public Table getTable(String schema,
                      String name)

getSchemaName

public String getSchemaName()

getDefaultCascade

public String getDefaultCascade()

setSchemaName

public void setSchemaName(String schemaName)
Sets the schemaName.

Parameters:
schemaName - The schemaName to set

setDefaultCascade

public void setDefaultCascade(String defaultCascade)
Sets the defaultCascade.

Parameters:
defaultCascade - The defaultCascade to set

setDefaultAccess

public void setDefaultAccess(String defaultAccess)
sets the default access strategy


getDefaultAccess

public String getDefaultAccess()

addQuery

public void addQuery(String name,
                     String query)
              throws MappingException
Throws:
MappingException

addSQLQuery

public void addSQLQuery(String name,
                        NamedSQLQuery query)
                 throws MappingException
Throws:
MappingException

getQuery

public String getQuery(String name)

isAutoImport

public boolean isAutoImport()
Returns the autoImport.

Returns:
boolean

setAutoImport

public void setAutoImport(boolean autoImport)
Sets the autoImport.

Parameters:
autoImport - The autoImport to set

addCache

public void addCache(String name,
                     CacheConcurrencyStrategy cache)
              throws MappingException
Throws:
MappingException

getDefaultPackage

public String getDefaultPackage()
Returns:
Returns the defaultPackage.

setDefaultPackage

public void setDefaultPackage(String defaultPackage)
Parameters:
defaultPackage - The defaultPackage to set.

getNamingStrategy

public NamingStrategy getNamingStrategy()