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

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

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

origin: org.grails/grails-datastore-core

private void registerEntityWithContext(PersistentEntity entity) {
  persistentEntities.remove(entity);
  persistentEntities.add(entity);
  persistentEntitiesByName.put(entity.getName(), entity);
}
origin: org.grails/grails-datastore-core

@Override
public Validator getValidator(PersistentEntity entity) {
  String validatorName = entity.getName() + "Validator";
  if (beanFactory.containsBean(validatorName)) {
    return beanFactory.getBean(validatorName, Validator.class);
  }
  return null;
}
origin: org.grails/grails-datastore-gorm

/**
 * Here for binary compatibility. Deprecated.
 *
 * @deprecated Use {@link #hasDateCreated(String)} instead
 */
protected boolean hasDateCreated(PersistentEntity entity) {
  return hasDateCreated(entity.getName());
}
origin: org.grails/grails-datastore-core

public static EntityReflector getOrIntializeReflector(PersistentEntity persistentEntity) {
  String entityName = persistentEntity.getName();
  EntityReflector entityReflector = REFLECTORS.get(entityName);
  if(entityReflector == null) {
    entityReflector = new FieldEntityReflector(persistentEntity);
    REFLECTORS.put(entityName, entityReflector);
  }
  return entityReflector;
}
origin: org.grails/grails-datastore-core

@Override
public void setPropertyNoConversion(String name, Object value) {
  try {
    reflector.setProperty(entity, name, value);
  } catch (Exception e) {
    String valueType = value != null ? value.getClass().getName() : null;
    throw new IllegalArgumentException("Cannot assign value ["+value+"] with type ["+valueType+"] to property ["+name+"] of class ["+persistentEntity.getName()+"]. The value is not an acceptable type: " + e.getMessage(), e);
  }
}
origin: org.grails/grails-datastore-core

@Override
public Family createMappedForm(PersistentEntity entity) {
  return new Family(keyspace, entity.getName());
}
origin: org.grails/grails-datastore-gorm

/**
 * Here for binary compatibility. Deprecated.
 *
 * @deprecated Use {@link #hasLastUpdated(String)} instead
 */
protected boolean hasLastUpdated(PersistentEntity entity) {
  return hasLastUpdated(entity.getName());
}
origin: org.grails/grails-datastore-core

/**
 * Builds a DELETE statement
 *
 * @return The JpaQueryInfo
 */
public JpaQueryInfo buildDelete() {
  StringBuilder queryString = new StringBuilder(DELETE_CLAUSE).append(entity.getName()).append(SPACE).append(logicalName);
  StringBuilder whereClause = new StringBuilder();
  List parameters = buildWhereClause(entity, criteria, queryString, whereClause, logicalName, false);
  return new JpaQueryInfo(queryString.toString(), parameters);
}
origin: org.grails/grails-datastore-core

private void buildSelectClause(StringBuilder queryString) {
  Query.ProjectionList projectionList = this.projectionList;
  String logicalName = this.logicalName;
  PersistentEntity entity = this.entity;
  buildSelect(queryString, projectionList.getProjectionList(), logicalName, entity);
  queryString.append(FROM_CLAUSE)
      .append(entity.getName())
      .append(AS_CLAUSE )
      .append(logicalName);
}
origin: org.grails/grails-datastore-gorm-hibernate-core

protected void initializeJoinStatus() {
  Boolean cachedStatus = JOIN_STATUS_CACHE.get(entity.getName());
  if(cachedStatus != null) hasJoins = cachedStatus;
  else {
    for(Association a : entity.getAssociations()) {
      if( a.getFetchStrategy() == FetchType.EAGER ) hasJoins = true;
    }
  }
}
origin: org.grails/grails-datastore-core

@Override
public void setIdentifierNoConversion(Object id) {
  try {
    reflector.setIdentifier(entity, id);
  } catch (Exception e) {
    throw new IllegalArgumentException("Cannot assign identifier ["+id+"] to property ["+reflector.getIdentifierName()+"] of type ["+reflector.identifierType().getName()+"] of class ["+persistentEntity.getName()+"]. The identifier is not an compatible type: " + e.getMessage(), e);
  }
}
origin: org.grails/grails-datastore-core

@Override
public String toString() {
  return getOwner().getName() + "->" + getName();
}
origin: org.grails/grails-datastore-gorm-hibernate-core

protected void logCascadeMapping(Association grailsProperty, String cascadeStrategy, PersistentEntity referenced) {
  if (LOG.isDebugEnabled() & referenced != null) {
    String assType = getAssociationDescription(grailsProperty);
    LOG.debug("Mapping cascade strategy for " + assType + " property " + grailsProperty.getOwner().getName() + "." + grailsProperty.getName() + " referencing type [" + referenced.getJavaClass().getName() + "] -> [CASCADE: " + cascadeStrategy + "]");
  }
}
origin: org.grails/grails-datastore-core

@Override
public void setProperty(String name, Object value) {
  FieldEntityReflector.PropertyWriter writer = reflector.getPropertyWriter(name);
  Object converted;
  try {
    converted = conversionService.convert(value, writer.propertyType());
  } catch (ConversionException e) {
    throw new IllegalArgumentException("Cannot assign value ["+value+"] to property ["+name+"] of type ["+writer.propertyType().getName()+"] of class ["+persistentEntity.getName()+"]. The value could not be converted to the appropriate type: " + e.getMessage(), e);
  } catch (Exception e) {
    throw new IllegalArgumentException("Cannot assign value ["+value+"] to property ["+name+"] of type ["+writer.propertyType().getName()+"] of class ["+persistentEntity.getName()+"]. The value is not an acceptable type: " + e.getMessage(), e);
  }
  writer.write(entity, converted);
}
origin: org.grails/grails-datastore-core

@Override
public void setIdentifier(Object id) {
  Object converted;
  try {
    converted = conversionService.convert(id, reflector.identifierType());
  } catch (ConversionException e) {
    throw new IllegalArgumentException("Cannot assign identifier ["+id+"] to property ["+reflector.getIdentifierName()+"] of type ["+reflector.identifierType().getName()+"] of class ["+persistentEntity.getName()+"]. The value could not be converted to the appropriate type: " + e.getMessage(), e);
  } catch (Exception e) {
    throw new IllegalArgumentException("Cannot assign identifier ["+id+"] to property ["+reflector.getIdentifierName()+"] of type ["+reflector.identifierType().getName()+"] of class ["+persistentEntity.getName()+"]. The identifier is not an compatible type: " + e.getMessage(), e);
  }
  reflector.setIdentifier(entity, converted);
}
origin: org.grails/grails-datastore-core

/**
 * @return The inverse side or null if the association is not bidirectional
 */
public Association getInverseSide() {
  final PersistentProperty associatedProperty = associatedEntity.getPropertyByName(referencedPropertyName);
  if (associatedProperty == null) return null;
  if (associatedProperty instanceof Association) {
    return (Association) associatedProperty;
  }
  throw new IllegalMappingException("The inverse side [" + associatedEntity.getName() + "." +
      associatedProperty.getName() + "] of the association [" + getOwner().getName() + "." +
      getName() + "] is not valid. Associations can only map to other entities and collection types.");
}
origin: org.grails/grails-datastore-gorm-hibernate-core

protected String getForeignKeyForPropertyDomainClass(PersistentProperty property,
    String sessionFactoryBeanName) {
  final String propertyName = NameUtils.decapitalize( property.getOwner().getName() );
  NamingStrategy namingStrategy = getNamingStrategy(sessionFactoryBeanName);
  return namingStrategy.propertyToColumnName(propertyName) + FOREIGN_KEY_SUFFIX;
}
origin: org.grails/grails-datastore-gorm

public boolean beforeUpdate(PersistentEntity entity, EntityAccess ea) {
  if (hasLastUpdated(entity.getName())) {
    Class<?> lastUpdateType = ea.getPropertyType(LAST_UPDATED_PROPERTY);
    Object timestamp = timestampProvider.createTimestamp(lastUpdateType);
    ea.setProperty(LAST_UPDATED_PROPERTY, timestamp);
  }
  return true;
}
origin: org.grails/grails-datastore-core

@Override
public Family createMappedForm(PersistentEntity entity) {
  Family family = super.createMappedForm(entity);
  if (family.getKeyspace() == null) {
    family.setKeyspace(keyspace);
  }
  if (family.getFamily() == null) {
    family.setFamily(entity.getName());
  }
  return family;
}
origin: org.grails/grails-datastore-gorm

protected void storeDateCreatedAndLastUpdatedInfo(PersistentEntity persistentEntity) {
  if(persistentEntity.isInitialized()) {
    ClassMapping<?> classMapping = persistentEntity.getMapping();
    Entity mappedForm = classMapping.getMappedForm();
    if(mappedForm == null || mappedForm.isAutoTimestamp()) {
      storeTimestampAvailability(entitiesWithDateCreated, persistentEntity, persistentEntity.getPropertyByName(DATE_CREATED_PROPERTY));
      storeTimestampAvailability(entitiesWithLastUpdated, persistentEntity, persistentEntity.getPropertyByName(LAST_UPDATED_PROPERTY));
    }
  }
  else {
    uninitializedEntities.add(persistentEntity.getName());
  }
}
org.grails.datastore.mapping.modelPersistentEntitygetName

Javadoc

The entity name including any package prefix

Popular methods of PersistentEntity

  • getJavaClass
  • 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
  • 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

  • Reading from database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
  • notifyDataSetChanged (ArrayAdapter)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Github Copilot alternatives
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