Codota Logo
Association.getName
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: org.grails/grails-hibernate

private String getAssociationPath(String propertyName) {
  StringBuilder fullPath = new StringBuilder();
  for (Iterator<Association> iterator = associationStack.iterator(); iterator.hasNext(); ) {
    Association association = iterator.next();
    fullPath.append(association.getName());
    fullPath.append('.');
  }
  fullPath.append(propertyName);
  return fullPath.toString();
}
origin: org.grails/grails-datastore-gorm-hibernate-core

protected String getAssociationPath(String propertyName) {
  if(propertyName.indexOf('.') > -1) {
    return propertyName;
  }
  else {
    StringBuilder fullPath = new StringBuilder();
    for (Association association : associationStack) {
      fullPath.append(association.getName());
      fullPath.append('.');
    }
    fullPath.append(propertyName);
    return fullPath.toString();
  }
}
origin: org.grails/gorm-graphql

/**
 * Designed for use when a projection query is used. The fetch arguments
 * need prepended with the projection property name.
 *
 * @param entity The {@link PersistentEntity} being queried
 * @param projectionName The name of the property being projected
 */
public EntityFetchOptions(PersistentEntity entity, String projectionName) {
  if (entity == null) {
    throw new IllegalArgumentException("Cannot retrieve fetch options for a null entity. Is GORM initialized?");
  }
  this.entity = entity;
  this.propertyName = projectionName;
  for (Association association : entity.getAssociations()) {
    associations.put(association.getName(), association);
  }
  associationNames = associations.keySet();
}
origin: org.grails/grails-datastore-core

private static int handleAssociationCriteria(StringBuilder query, StringBuilder whereClause, String logicalName, int position, List parameters, ConversionService conversionService, boolean allowJoins, Association<?> association, Query.Junction associationCriteria, List<Query.Criterion> associationCriteriaList, boolean hibernateCompatible) {
  if (association instanceof ToOne) {
    final String associationName = association.getName();
    logicalName = logicalName + DOT + associationName;
    return buildWhereClauseForCriterion(association.getAssociatedEntity(), associationCriteria, query, whereClause, logicalName, associationCriteriaList, position, parameters, conversionService, allowJoins, hibernateCompatible);
  }
  if (association != null) {
    final String associationName = association.getName();
    // TODO: Allow customization of join strategy!
    String joinType = " INNER JOIN ";
    query.append(joinType)
     .append(logicalName)
     .append(DOT)
     .append(associationName)
     .append(SPACE)
     .append(associationName);
    return buildWhereClauseForCriterion(association.getAssociatedEntity(), associationCriteria, query, whereClause, associationName, associationCriteriaList, position, parameters, conversionService, allowJoins, hibernateCompatible);
  }
  return position;
}
origin: org.grails/grails-datastore-core

protected void cascadeDeleteCollection(EntityAccess entityAccess, Association association) {
  Object propValue = entityAccess.getProperty(association.getName());
  if (!(propValue instanceof Collection)) {
    return;
  }
  Collection collection = ((Collection) propValue);
  for (Iterator iter = collection.iterator(); iter.hasNext(); ) {
    Object child = iter.next();
    deleteEntity(getMappingContext().getPersistentEntity(child.getClass().getName()), child);
    iter.remove();
  }
}
origin: org.grails/grails-datastore-core

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

String handleAssociationQuery(Association<?> association, List<Criterion> criteriaList, String alias) {
  String associationName = calculatePropertyName(association.getName());
  return getOrCreateAlias(associationName, alias).alias;
}
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-hibernate

private CriteriaAndAlias getCriteriaAndAlias(Association<?> association) {
  String associationName = calculatePropertyName(association.getName());
  String newAlias = generateAlias(associationName);
  return getOrCreateAlias(associationName, newAlias);
}
origin: org.grails/grails-datastore-gorm-hibernate-core

protected CriteriaAndAlias getCriteriaAndAlias(Association<?> association) {
  String associationName = calculatePropertyName(association.getName());
  String newAlias = generateAlias(associationName);
  return getOrCreateAlias(associationName, newAlias);
}
origin: org.grails/grails-datastore-gorm-hibernate-core

protected CriteriaAndAlias getCriteriaAndAlias(DetachedAssociationCriteria associationCriteria) {
  String associationPath = associationCriteria.getAssociationPath();
  String alias = associationCriteria.getAlias();
  if(associationPath == null) {
    associationPath = associationCriteria.getAssociation().getName();
  }
  return getOrCreateAlias(associationPath, alias);
}
origin: org.grails/grails-datastore-core

protected void handleEmbeddedToOne(Association association, String key, EntityAccess entityAccess, T nativeEntry) {
  Object embeddedInstance = entityAccess.getProperty(association.getName());
  if (embeddedInstance == null) {
    setEmbedded(nativeEntry, key, null);
    return;
  }
  T embeddedEntry = handleEmbeddedInstance(association, embeddedInstance);
  setEmbedded(nativeEntry, key, embeddedEntry);
}
origin: org.grails/grails-datastore-core

public static String associationtoString(String desc, Association a) {
  return desc + a.getOwner().getName() + "-> " + a.getName() + " ->" + a.getAssociatedEntity().getName();
}
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-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();
}
origin: org.grails/grails-datastore-gorm-hibernate-core

String associationName = association.getName();
if (getCurrentAlias() != null) {
  associationName = getCurrentAlias() + '.' + associationName;
origin: org.grails/grails-datastore-gorm-hibernate-core

mapping.getColumns().put(property.getName(), pc);
columnConfig.setName(namingStrategy.propertyToColumnName(property.getName()) +
    UNDERSCORE + FOREIGN_KEY_SUFFIX);
jt.setKey(columnConfig);
origin: org.grails/grails-datastore-core

AssociationQuery associationQuery = createQuery(ac.getAssociation().getName());
for (Criterion associationCriterion : ac.getCriteria()) {
  associationQuery.add(associationCriterion);
origin: org.grails/grails-datastore-gorm-hibernate-core

protected void bindOneToOne(final org.grails.datastore.mapping.model.types.OneToOne property, OneToOne oneToOne,
    String path, String sessionFactoryBeanName) {
  PropertyConfig config = getPropertyConfig(property);
  final Association otherSide = property.getInverseSide();
  final boolean hasOne = isHasOne(otherSide);
  oneToOne.setConstrained(hasOne);
  oneToOne.setForeignKeyType(oneToOne.isConstrained() ?
                ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT :
                ForeignKeyDirection.FOREIGN_KEY_TO_PARENT);
  oneToOne.setAlternateUniqueKey(true);
  if (config != null && config.getFetchMode() != null) {
    oneToOne.setFetchMode(config.getFetchMode());
  }
  else {
    oneToOne.setFetchMode(FetchMode.DEFAULT);
  }
  oneToOne.setReferencedEntityName(otherSide.getOwner().getName());
  oneToOne.setPropertyName(property.getName());
  bindOneToOneInternal(property, oneToOne, path);
  if (hasOne) {
    PropertyConfig pc = getPropertyConfig(property);
    bindSimpleValue(property, oneToOne, path, pc, sessionFactoryBeanName);
  }
  else {
    oneToOne.setReferencedPropertyName(otherSide.getName());
  }
}
origin: org.grails/grails-datastore-core

embeddedEntry = createNewEntry(association.getName());
      Association toOne = (Association) persistentProperty;
      Object obj = embeddedEntityAccess.getProperty(toOne.getName());
      Persister persister = getSession().getPersister(obj);
      if (persister != null) {
org.grails.datastore.mapping.model.typesAssociationgetName

Popular methods of Association

  • getAssociatedEntity
  • getInverseSide
  • getOwner
  • getType
  • isBidirectional
  • isEmbedded
  • isOwningSide
    Returns whether this side owns the relationship. This controls the default cascading behavior if non
  • buildCascadeOperations
  • doesCascade
    Returns true if the this association cascade for the given cascade operation
  • getCascadeOperations
  • getFetchStrategy
  • getMapping
  • getFetchStrategy,
  • getMapping,
  • getReferencedPropertyName,
  • isCircular,
  • setAssociatedEntity,
  • setOwningSide,
  • setReferencedPropertyName

Popular in Java

  • Making http post requests using okhttp
  • getContentResolver (Context)
  • getExternalFilesDir (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • JFrame (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now