Tabnine Logo
PersistentEntity.getJavaClass
Code IndexAdd Tabnine to your IDE (free)

How to use
getJavaClass
method
in
org.grails.datastore.mapping.model.PersistentEntity

Best Java code snippets using org.grails.datastore.mapping.model.PersistentEntity.getJavaClass (Showing top 20 results out of 315)

origin: org.grails/grails-datastore-core

@Override
public boolean equals(Object o) {
  if (o == null || !(o instanceof PersistentEntity)) return false;
  if (this == o) return true;
  PersistentEntity other = (PersistentEntity) o;
  return javaClass.equals(other.getJavaClass());
}
origin: org.grails/grails-datastore-gorm-hibernate-core

/**
 * Obtains a mapping object for the given domain class nam
 *
 * @param domainClass The domain class in question
 * @return A Mapping object or null
 */
public static Mapping getMapping(PersistentEntity domainClass) {
  return domainClass == null ? null : MAPPING_CACHE.get(domainClass.getJavaClass());
}
origin: org.grails/grails-datastore-core

@Override
public PropertyWriter getPropertyWriter(String name) {
  final PropertyWriter writer = writerMap.get(name);
  if(writer != null) {
    return writer;
  }
  else {
    throw new IllegalArgumentException("Property ["+name+"] is not a valid property of " + entity.getJavaClass());
  }
}
origin: org.grails/grails-datastore-core

public TPCacheAdapter<T> getTPCacheAdapter(PersistentEntity entity) {
  if (entity == null) {
    return null;
  }
  return adapters.get(entity.getJavaClass().getName());
}
origin: org.grails/grails-datastore-gorm-hibernate-core

protected Mapping getRootMapping(PersistentEntity referenced) {
  if (referenced == null) return null;
  Class<?> current = referenced.getJavaClass();
  while (true) {
    Class<?> superClass = current.getSuperclass();
    if (Object.class.equals(superClass)) break;
    current = superClass;
  }
  return getMapping(current);
}
origin: org.grails/grails-datastore-core

@Override
public FastClass fastClass() {
  if(fastClass == null) {
    fastClass = FastClass.create(entity.getJavaClass());
  }
  return fastClass;
}
origin: org.grails/grails-datastore-core

protected AbstractPersistentCollection(Serializable associationKey, Session session,
                    AssociationQueryExecutor indexer, Collection collection) {
  this.session = session;
  this.associationKey = associationKey;
  this.indexer = indexer;
  this.collection = collection;
  this.childType = indexer.getIndexedEntity().getJavaClass();
}
origin: org.grails/grails-datastore-core

public AssociationQueryProxyHandler(Session session, AssociationQueryExecutor executor, Serializable associationKey) {
  super(executor.getIndexedEntity().getJavaClass());
  this.session = session;
  this.executor = executor;
  this.associationKey = associationKey;
}
origin: org.grails/grails-datastore-core

public Collection getCachedCollection(PersistentEntity entity, Serializable key, String name) {
  if(isStateless(entity)) return null;
  if (key == null || name == null) {
    return null;
  }
  return firstLevelCollectionCache.get(
      new CollectionKey(entity.getJavaClass(), key, name));
}
origin: org.grails/grails-datastore-core

public Object getCachedEntry(PersistentEntity entity, Serializable key, boolean forDirtyCheck) {
  if(isStateless(entity)) return null;
  if (key == null) {
    return null;
  }
  return getEntryCache(entity.getJavaClass(), forDirtyCheck).get(key);
}
origin: org.grails/grails-datastore-core

public void cacheCollection(PersistentEntity entity, Serializable key, Collection collection, String name) {
  if(isStateless(entity)) return;
  if (key == null || collection == null || name == null) {
    return;
  }
  firstLevelCollectionCache.put(
      new CollectionKey(entity.getJavaClass(), key, name),
      collection);
}
origin: org.grails/grails-datastore-core

public void cacheEntry(PersistentEntity entity, Serializable key, Object entry) {
  if(isStateless(entity)) return;
  if (key == null || entry == null) {
    return;
  }
  cacheEntry(key, entry, getEntryCache(entity.getJavaClass(), true), true);
  cacheEntry(key, entry, getEntryCache(entity.getJavaClass(), false), false);
}
origin: org.grails/grails-datastore-core

@Override
public Object clone() {
  Session session = getSession();
  if(session == null) throw new IllegalStateException("Cannot clone a stateless query");
  Query newQuery = session.createQuery(entity.getJavaClass());
  for (Criterion criterion : criteria.getCriteria()) {
    newQuery.add(criterion);
  }
  return newQuery;
}
origin: org.grails/grails-datastore-gorm-validation

protected boolean canApplyNullableConstraint(String propertyName, PersistentProperty property, Constrained constrained) {
  if (property == null || property.getType() == null) return false;
  final PersistentEntity domainClass = property.getOwner();
  // only apply default nullable to Groovy entities not legacy Java ones
  if (!GroovyObject.class.isAssignableFrom(domainClass.getJavaClass())) return false;
  final PersistentProperty versionProperty = domainClass.getVersion();
  final boolean isVersion = versionProperty != null && versionProperty.equals(property);
  return !constrained.hasAppliedConstraint(ConstrainedProperty.NULLABLE_CONSTRAINT) &&
      isConstrainableProperty(property, propertyName) && !isVersion;
}
origin: org.grails/grails-hibernate

public static org.hibernate.criterion.DetachedCriteria getHibernateDetachedCriteria(QueryableCriteria<?> queryableCriteria) {
  org.hibernate.criterion.DetachedCriteria detachedCriteria = org.hibernate.criterion.DetachedCriteria.forClass(
     queryableCriteria.getPersistentEntity().getJavaClass());
  populateHibernateDetachedCriteria(detachedCriteria, queryableCriteria);
  return detachedCriteria;
}
origin: org.grails/grails-datastore-gorm-hibernate-core

public Mapping evaluateMapping(PersistentEntity domainClass, Closure<?> defaultMapping, boolean cache) {
  try {
    final Mapping m = (Mapping) domainClass.getMapping().getMappedForm();
    trackCustomCascadingSaves(m, domainClass.getPersistentProperties());
    if (cache) {
      MAPPING_CACHE.put(domainClass.getJavaClass(), m);
    }
    return m;
  } catch (Exception e) {
    throw new DatastoreConfigurationException("Error evaluating ORM mappings block for domain [" +
        domainClass.getName() + "]:  " + e.getMessage(), e);
  }
}
origin: org.grails/grails-datastore-gorm-hibernate-core

protected boolean isComponentPropertyNullable(PersistentProperty componentProperty) {
  if (componentProperty == null) return false;
  final PersistentEntity domainClass = componentProperty.getOwner();
  final Mapping mapping = getMapping(domainClass.getJavaClass());
  return !domainClass.isRoot() && (mapping == null || mapping.isTablePerHierarchy()) || componentProperty.isNullable();
}
origin: org.grails/grails-datastore-core

@Override
public <T, K extends Serializable> T createProxy(Session session, AssociationQueryExecutor<K, T> executor, K associationKey) {
  MethodHandler mi = createMethodHandler(session, executor, associationKey);
  Class proxyClass = getProxyClass(executor.getIndexedEntity().getJavaClass());
  Object proxy = ReflectionUtils.instantiate(proxyClass);
  ((ProxyObject)proxy).setHandler(mi);
  return (T) proxy;
}
origin: org.grails/grails-datastore-core

@SuppressWarnings("unchecked")
public Object proxy(Serializable key) {
  PersistentEntity entity = getPersistentEntity();
  PersistentProperty identity = entity.getIdentity();
  if(identity != null) {
    key = (Serializable) mappingContext.getConversionService().convert(key, identity.getType());
  }
  return getProxyFactory().createProxy(session, entity.getJavaClass(), key);
}
origin: org.grails/grails-datastore-core

@Override
public List query(Object primaryKey) {
  Association inverseSide = association.getInverseSide();
  Query query = session.createQuery(association.getAssociatedEntity().getJavaClass());
  query.eq(inverseSide.getName(), primaryKey);
  query.projections().id();
  return query.list();
}
org.grails.datastore.mapping.modelPersistentEntitygetJavaClass

Popular methods of PersistentEntity

  • getIdentity
    Returns the identity of the instance
  • getMapping
    Defines the mapping between this persistent entity and an external form
  • getPropertyByName
    Obtains a PersistentProperty instance by name
  • getName
    The entity name including any package prefix
  • getPersistentProperties
    A list of properties to be persisted
  • getVersion
    Returns the version property.
  • isMultiTenant
  • getAssociations
    A list of the associations for this entity. This is typically a subset of the list returned by #getP
  • getCompositeIdentity
    The composite id
  • getMappingContext
    Obtains the MappingContext where this PersistentEntity is defined
  • getReflector
  • getTenantId
  • getReflector,
  • getTenantId,
  • isInitialized,
  • isOwningEntity,
  • isRoot,
  • isVersioned,
  • addOwner,
  • getDecapitalizedName,
  • getDiscriminator

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSharedPreferences (Context)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now