code: @SuppressWarnings( { "unchecked" })
      public static <T> Enhancer<T> getDirtyableDBObjectEnhancer(Class<T> baseClass) {
          if (dirtyableDBObjectEnhancers.containsKey(baseClass)) {
              return (Enhancer<T>) dirtyableDBObjectEnhancers.get(baseClass);
          }
  
          synchronized (dirtyableDBObjectEnhancers) {
              Enhancer<T> enhancer;
  
              if (dirtyableDBObjectEnhancers.get(baseClass) != null) {
                  enhancer = (Enhancer<T>) dirtyableDBObjectEnhancers.get(baseClass);
              } else if (DirtyableDBObject.class.isAssignableFrom(baseClass)) {
                  enhancer = new NoOpEnhancer<T>(baseClass);
  
                  dirtyableDBObjectEnhancers.put(baseClass, enhancer);
              } else {
                  enhancer = new EntityVelocityEnhancer<T>(baseClass) {
                      //-------------------------------------------------------------
                      // Implementation - Enhancer
                      //-------------------------------------------------------------
  
                      @Override
                      public boolean needsEnhancement(Object object) {
                          return object != null && !(object instanceof DirtyableDBObject);
                      }
  
  
                      //-------------------------------------------------------------
                      // Implementation - VelocityEnhancer
                      //-------------------------------------------------------------
  
                      @Override
                      protected String getTemplateLocation() {
                          return "org/iternine/jeppetto/dao/mongodb/enhance/dirtyableDBObject.vm";
                      }
                  };
  
                  dirtyableDBObjectEnhancers.put(baseClass, enhancer);
              }
  
              return enhancer;
          }
      }
docs: Creates a new dirtyableDBObject Enhancer for the given class. If the class already implements
  {@link DirtyableDBObject}, then a special "no-op" enhancer will be returned that
  doesn't do any special enhancement. Otherwise, a byte-code enhancer is returned.
  
  @param baseClass class for which to create an enhancer
  
  @return new enhancer