public ProxyFactory getProxyFactory() { if (proxyFactory == null) { proxyFactory = mappingContext.getProxyFactory(); } return proxyFactory; }
protected Object resolveIdIfEntity(Object value) { // use the object id as the value if its a persistent entity MappingContext mappingContext = entity.getMappingContext(); if (mappingContext.getProxyFactory().isProxy(value)) { return mappingContext.getProxyFactory().getIdentifier(value); } return mappingContext.isPersistentEntity(value) ? findInstanceId(value) : value; }