net.sf.hibernate4gwt.core.beanlib.mapper
Class ExplicitClassMapper

java.lang.Object
  extended by net.sf.hibernate4gwt.core.beanlib.mapper.ExplicitClassMapper
All Implemented Interfaces:
IClassMapper

public class ExplicitClassMapper
extends java.lang.Object
implements IClassMapper

Class mapper based on explicitly parameterized classes

Author:
Olaf Kock, Florian Siebert

Constructor Summary
ExplicitClassMapper()
          Constructor
 
Method Summary
 void addAssociation(java.lang.Class sourceclass, java.lang.Class targetclass)
          Add an association between source- and Clone-Class, where source is the domain class that shall be cloned to the given clone class, in order to be transferable via gwt to the client.
 java.lang.Class getSourceClass(java.lang.Class targetClass)
           
 java.lang.Class getTargetClass(java.lang.Class sourceClass)
           
 void setAssociations(java.util.Map<java.lang.Class,java.lang.Class> mappings)
          Set the associations between source- and Clone-Class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExplicitClassMapper

public ExplicitClassMapper()
Constructor

Method Detail

addAssociation

public void addAssociation(java.lang.Class sourceclass,
                           java.lang.Class targetclass)
Add an association between source- and Clone-Class, where source is the domain class that shall be cloned to the given clone class, in order to be transferable via gwt to the client.

Parameters:
sourceclass - your hibernate-domain-class
targetclass - the class to be transferred to the gwt client

setAssociations

public void setAssociations(java.util.Map<java.lang.Class,java.lang.Class> mappings)
Set the associations between source- and Clone-Class. All previous association get deleted.

Parameters:
mappings - map with sourcClass as key and targetClass as value

getTargetClass

public java.lang.Class getTargetClass(java.lang.Class sourceClass)
Specified by:
getTargetClass in interface IClassMapper
Returns:
the mapped class for the argument class

getSourceClass

public java.lang.Class getSourceClass(java.lang.Class targetClass)
Specified by:
getSourceClass in interface IClassMapper
Returns:
the mapped class for the argument class