Code example for EmptyInterceptor

0
import org.slf4j.Logger; 
import org.slf4j.LoggerFactory; 
 
import pt.ist.fenixframework.core.DomainObjectAllocator; 
 
public class AllocationInterceptor extends EmptyInterceptor {
    private static final Logger logger = LoggerFactory.getLogger(AllocationInterceptor.class);
 
    private final DomainObjectAllocator allocator = new DomainObjectAllocator(OgmDomainObject.class);
 
    // @Override 
    // public Boolean isTransient(Object entity) { 
    //     logger.trace("isTransient(" + entity.getClass().getName() + ")?"); 
    //     try { 
    //         OgmDomainObject obj = (OgmDomainObject)entity; 
    //         logger.trace("isTransient(" + entity.getClass().getName() + ")?: " + (obj.getHibernate$primaryKey() == null)); 
    //         return obj.getHibernate$primaryKey() == null; 
    //     } catch (ClassCastException ex) { 
    //         // not a domain object 
    //         logger.trace("isTransient(" + entity.getClass().getName() + ")?: UNKNOWN"); 
Contextual code suggestions in your IDE  Get Codota for Java