Tabnine Logo
org.grails.datastore.mapping.model
Code IndexAdd Tabnine to your IDE (free)

How to use org.grails.datastore.mapping.model

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

origin: org.grails/grails-datastore-core

  public Property getMappedForm() {
    return classMapping.getEntity().getIdentity().getMapping().getMappedForm();
  }
};
origin: org.grails/grails-datastore-core

public DocumentCollectionMapping(PersistentEntity entity, MappingContext context) {
  super(entity, context);
  if(entity.isExternal()) {
    this.mappedForm = null;
  }
  else {
    this.mappedForm = (Collection) context.getMappingFactory().createMappedForm(DocumentPersistentEntity.this);
  }
}
@Override
origin: org.grails/grails-datastore-core

@Override
public void setCanInitializeEntities(boolean canInitializeEntities) {
  super.setCanInitializeEntities(canInitializeEntities);
  syntaxStrategy.setCanExpandMappingContext(false);
}
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

  @Override
  public void convertArguments(PersistentEntity persistentEntity) {
    ConversionService conversionService = persistentEntity
        .getMappingContext().getConversionService();
    String propertyName = this.propertyName;
    PersistentProperty<?> prop = persistentEntity
        .getPropertyByName(propertyName);
    Object[] arguments = this.arguments;
    convertArgumentsForProp(persistentEntity, prop, propertyName, arguments, conversionService);
  }
}
origin: org.grails/grails-datastore-core

@Override
protected String getNativePropertyKey(PersistentProperty prop) {
  PropertyMapping<KeyValue> pm = prop.getMapping();
  String propKey = null;
  if (pm.getMappedForm()!=null) {
    propKey = pm.getMappedForm().getKey();
  }
  if (propKey == null) {
    propKey = prop.getName();
  }
  return propKey;
}
origin: org.grails/grails-datastore-core

@Override
public Class getPropertyType(String name) {
  PersistentProperty property = persistentEntity.getPropertyByName(name);
  if(property != null) {
    return property.getType();
  }
  return null;
}
origin: org.grails/grails-datastore-core

public NativeEntryEntityPersister(MappingContext mappingContext, PersistentEntity entity,
     Session session, ApplicationEventPublisher publisher) {
  super(mappingContext, entity, session, publisher);
  classMapping = entity.getMapping();
}
origin: org.grails/grails-datastore-core

public PersistentEntity getRootEntity() {
  PersistentEntity root = this;
  PersistentEntity parent = getParentEntity();
  while (parent != null) {
    if(!parent.isInitialized()) {
      parent.initialize();
    }
    root = parent;
    parent = parent.getParentEntity();
  }
  return root;
}
origin: org.grails/grails-datastore-gorm-hibernate-core

public HibernatePersistentEntity(Class javaClass, final MappingContext context) {
  super(javaClass, context);
  this.classMapping = new AbstractClassMapping<Mapping>(this, context) {
    Mapping mappedForm = (Mapping) context.getMappingFactory().createMappedForm(HibernatePersistentEntity.this);
    @Override
    public PersistentEntity getEntity() {
      return HibernatePersistentEntity.this;
    }
    @Override
    public Mapping getMappedForm() {
      return mappedForm;
    }
  };
}
origin: org.grails/grails-datastore-core

/**
 * Obtains the identifier name to use. Subclasses can override to provide their own strategy for looking up an identifier name
 * @param cm The ClassMapping instance
 * @return The identifier name
 */
protected String getIdentifierName(ClassMapping cm) {
  return cm.getIdentifier().getIdentifierName()[0];
}
origin: org.grails/grails-datastore-core

  @Override
  public IdentityMapping getIdentifier() {
    if (identityMapping == null) {
      identityMapping = context.getMappingFactory().createIdentityMapping(this);
    }
    return identityMapping;
  }
}
origin: org.grails/grails-datastore-core

public AbstractClassMapping(PersistentEntity entity, MappingContext context) {
  this.entity = entity;
  this.context = context;
  MappingConfigurationStrategy syntaxStrategy = context.getMappingSyntaxStrategy();
  this.identifierMapping = syntaxStrategy.getIdentityMapping(this);
}
origin: org.grails/grails-datastore-core

public PersistentEntity createEmbeddedEntity(Class type) {
  EmbeddedPersistentEntity embedded = new EmbeddedPersistentEntity(type, this);
  embedded.initialize();
  return embedded;
}
origin: org.grails/grails-datastore-core

protected PersistentProperty resolveIdentifier() {
  return context.getMappingSyntaxStrategy().getIdentity(javaClass, context);
}
origin: org.grails/grails-datastore-core

/**
 * Obtains the identity mapping for the specified class mapping
 *
 * @param classMapping The class mapping
 * @return The identity mapping
 */
public IdentityMapping getIdentityMapping(ClassMapping classMapping) {
  return propertyFactory.createIdentityMapping(classMapping);
}
origin: org.grails/grails-datastore-core

  public Property getMappedForm() {
    return classMapping.getEntity().getIdentity().getMapping().getMappedForm();
  }
};
origin: org.grails/grails-datastore-gorm

@Override
public void convertArguments(PersistentEntity persistentEntity) {
  ConversionService conversionService = persistentEntity
      .getMappingContext().getConversionService();
  PersistentProperty<?> prop = persistentEntity
      .getPropertyByName(propertyName);
  convertArgumentsForProp(persistentEntity, prop, propertyName, arguments, conversionService);
}
origin: org.grails/grails-datastore-core

protected String getIdentifierName(ClassMapping cm) {
  final IdentityMapping identifier = cm.getIdentifier();
  if (identifier != null && identifier.getIdentifierName() != null) {
    String[] identifierName = identifier.getIdentifierName();
    if(identifierName.length > 0) {
      return identifierName[0];
    }
  }
  return null;
}
origin: org.grails/grails-datastore-core

public String[] getIdentifierName() {
  PersistentProperty identity = classMapping.getEntity().getIdentity();
  String propertyName = identity != null ? identity.getMapping().getMappedForm().getName() : null;
  if(propertyName != null) {
    return new String[] { propertyName };
  }
  else {
    return new String[] { IDENTITY_PROPERTY };
  }
}
org.grails.datastore.mapping.model

Most used classes

  • MappingContext
    Defines the overall context including all known PersistentEntity instances and methods to obtain ins
  • PersistentEntity
    Represents a persistent entity.
  • PersistentProperty
  • Association
    Models an association between one class and another
  • ClassMapping
    A class mapping is a mapping between a class and some external form such as a table, column family,
  • PropertyMapping,
  • AbstractMappingContext,
  • DatastoreConfigurationException,
  • MappingFactory,
  • ValueGenerator,
  • Basic,
  • Embedded,
  • ManyToMany,
  • OneToMany,
  • TenantId,
  • ToMany,
  • AbstractMappingContext$DefaultProxyFactoryCreator,
  • AbstractPersistentEntity,
  • AbstractPersistentProperty
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