org.shept.persistence.provider
Class DaoUtils
java.lang.Object
org.shept.persistence.provider.DaoUtils
public class DaoUtils
- extends Object
- Version:
- $Revision: 72 $
- Author:
- $Author: aha $
|
Method Summary |
static void |
checkProvider(org.springframework.dao.support.DaoSupport dao)
|
private static Object |
copyTemplate_Experimental(org.springframework.orm.hibernate3.support.HibernateDaoSupport dao,
Object entityModelTemplate)
|
static Object |
deepCopyModel(org.springframework.dao.support.DaoSupport dao,
Object entityModelTemplate)
This deepCopy will copy all properties of the template model but ignore
the id. |
private static org.hibernate.metadata.ClassMetadata |
getClassMetadata(org.springframework.dao.support.DaoSupport dao,
Object model)
|
private static String |
getIdentifierPropertyName_old(org.springframework.dao.support.DaoSupport dao,
Object model)
|
private static Serializable |
getIdValue_old(org.springframework.dao.support.DaoSupport dao,
Object model)
|
static Object |
getIdValue(org.springframework.dao.support.DaoSupport dao,
Object entityModelTemplate)
|
static boolean |
isEntity(org.springframework.dao.support.DaoSupport dao,
Object entityModelTemplate)
|
static boolean |
isNewModel(org.springframework.dao.support.DaoSupport dao,
Object model)
Checking if it is a new model (identifier == null) If the index is a
compound index we must check all components if just one of them is null |
static Object |
shallowCopyModel(org.springframework.dao.support.DaoSupport dao,
Object entityModelTemplate,
boolean includeId)
This Hibernate specific code will create shallow copies of the model
object |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DaoUtils
public DaoUtils()
getClassMetadata
private static org.hibernate.metadata.ClassMetadata getClassMetadata(org.springframework.dao.support.DaoSupport dao,
Object model)
isEntity
public static boolean isEntity(org.springframework.dao.support.DaoSupport dao,
Object entityModelTemplate)
- Parameters:
dao - entityModelTemplate -
- Returns:
- true if the requested entityModelTemplate Object is managed by the persistent layer
getIdValue
public static Object getIdValue(org.springframework.dao.support.DaoSupport dao,
Object entityModelTemplate)
isNewModel
public static boolean isNewModel(org.springframework.dao.support.DaoSupport dao,
Object model)
- Checking if it is a new model (identifier == null) If the index is a
compound index we must check all components if just one of them is null
- Parameters:
index -
- Returns:
deepCopyModel
public static Object deepCopyModel(org.springframework.dao.support.DaoSupport dao,
Object entityModelTemplate)
- This deepCopy will copy all properties of the template model but ignore
the id. In case the id is a compound id the the resulting copy will get a
deepCopy of the id if the composite id is only partially filled
NOTE that the method will only create shallow copies except for component
properties which will be deep copied This means that collections and
associations will NOT be deep copied
- Parameters:
dao - entityModelTemplate -
- Returns:
- a copy of the entityModelTemplate
shallowCopyModel
public static Object shallowCopyModel(org.springframework.dao.support.DaoSupport dao,
Object entityModelTemplate,
boolean includeId)
- This Hibernate specific code will create shallow copies of the model
object
- Parameters:
dao - entityModelTemplate - includeId - true if the id is to be included
- Returns:
checkProvider
public static void checkProvider(org.springframework.dao.support.DaoSupport dao)
getIdValue_old
private static Serializable getIdValue_old(org.springframework.dao.support.DaoSupport dao,
Object model)
getIdentifierPropertyName_old
private static String getIdentifierPropertyName_old(org.springframework.dao.support.DaoSupport dao,
Object model)
copyTemplate_Experimental
private static Object copyTemplate_Experimental(org.springframework.orm.hibernate3.support.HibernateDaoSupport dao,
Object entityModelTemplate)
Copyright © 2011. All Rights Reserved.