org.grails.datastore.mapping.proxy.ProxyHandler.isProxy() - java examples

Here are the examples of the java api org.grails.datastore.mapping.proxy.ProxyHandler.isProxy() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 View Complete Implementation : HibernateSession.java
Copyright Apache License 2.0
Author : grails
@Override
public Serializable getObjectIdentifier(Object instance) {
    if (instance == null)
        return null;
    if (proxyHandler.isProxy(instance)) {
        return ((HibernateProxy) instance).getHibernateLazyInitializer().getIdentifier();
    }
    Clreplaced<?> type = instance.getClreplaced();
    ClreplacedPropertyFetcher cpf = ClreplacedPropertyFetcher.forClreplaced(type);
    final PersistentEnreplacedy persistentEnreplacedy = getMappingContext().getPersistentEnreplacedy(type.getName());
    if (persistentEnreplacedy != null) {
        return (Serializable) cpf.getPropertyValue(instance, persistentEnreplacedy.getIdenreplacedy().getName());
    }
    return null;
}