Tabnine Logo
Column.getTypeMapper
Code IndexAdd Tabnine to your IDE (free)

How to use
getTypeMapper
method
in
com.speedment.runtime.config.Column

Best Java code snippets using com.speedment.runtime.config.Column.getTypeMapper (Showing top 11 results out of 315)

origin: speedment/speedment

private boolean hasTypeMapper(Column col, Class<?> typeMapperClass) {
  return col.getTypeMapper()
    .filter(typeMapperClass.getName()::equals)
    .isPresent();
}
origin: speedment/speedment

/**
 * Set any compatible type mappers in Project <code>{@code to}</code> found in Project <code>{@code from}</code>.
 **
 * @param to the project to mutate
 * @param from the project defining the type mappers
 */
private void setTypeMappersFrom(Project to, Project from) {
  from.dbmses().map(d -> (Dbms) d).forEach(dbms -> {
    dbms.schemas().map(s -> (Schema) s).forEach(schema -> {
      schema.tables().map(t -> (Table) t).forEach(table -> {
        table.columns().map(c -> (Column) c).filter(c -> c.getTypeMapper().isPresent()).forEach(column -> {
          String mapperName = column.getTypeMapper().get();
          try {
            //noinspection unchecked
            @SuppressWarnings("unchecked")
            Class<? extends TypeMapper<?, ?>> mapperClass = (Class<? extends TypeMapper<?, ?>>)Class.forName(mapperName);
            setTypeMapper(to, dbms, schema, table, column,  mapperClass);
          } catch (ClassNotFoundException | ClassCastException e) {
            throw new IllegalStateException("Unable to find mapper class " + mapperName);
          }
        });
      });
    });
  });
}
origin: speedment/speedment

/**
 * Debug method used to track type mappers of a project. May be of future use if one perhaps would venture to
 * investigate why we get several copies of the dbms from the database
 */
private void printTypeMappers(String heading, Project p) {
  System.out.println(heading);
  p.dbmses().map(d -> (Dbms) d).forEach(dbms -> {
    dbms.schemas().map(s -> (Schema) s).forEach(schema -> {
      schema.tables().map(t -> (Table) t).forEach(table -> {
        table.columns().map(c -> (Column) c).filter(c -> c.getTypeMapper().isPresent()).forEach(column -> {
          String mapperName = column.getTypeMapper().get();
          if (mapperName.endsWith("PrimitiveTypeMapper")) {
            mapperName = "Primitive";
          }
          System.out.println(" - " + dbms.getName() + ":" + schema.getName() + "/" +
            table.getName() + "." + column.getName() + " mapped by " + mapperName);
        });
      });
    });
  });
}
origin: speedment/speedment

final boolean isCustomTypeMapper = c.getTypeMapper().isPresent()
  && !TypeMapper.identity().getClass().isAssignableFrom(typeMapperClass)
  && !TypeMapper.primitive().getClass().isAssignableFrom(typeMapperClass);
origin: speedment/speedment

ImmutableColumn(ImmutableTable parent, Map<String, Object> data) {
  super(parent, data);
  
  final Column prototype = new ColumnImpl(parent, data);
  
  this.enabled                = prototype.isEnabled();
  this.id                     = prototype.getId();
  this.name                   = prototype.getName();
  this.alias                  = prototype.getAlias();
  this.nullable               = prototype.isNullable();
  this.nullableImplementation = prototype.getNullableImplementation();
  this.autoincrement          = prototype.isAutoIncrement();
  this.typeMapper             = prototype.getTypeMapper();
  this.databaseType           = prototype.getDatabaseType();
  this.databaseTypeObject     = prototype.findDatabaseType();
  this.enumConstants          = prototype.getEnumConstants();
  this.decimalDigits          = prototype.getDecimalDigits();
  this.columnSize             = prototype.getColumnSize();
  this.ordinalPosition        = prototype.getOrdinalPosition();
}
origin: speedment/speedment

.filter(c -> c.getTypeMapper()
.filter(tm -> !"".equals(tm))
.filter(tm -> !tm.equals(TypeMapper.identity().getClass().getName()))
origin: speedment/speedment

.filter(col -> col.getTypeMapper()
  .filter(ENUM_TYPE_MAPPERS::contains)
  .isPresent()
    throw new UnsupportedOperationException(format(
      "Unknown enum type mapper '%s' in column '%s'.",
      col.getTypeMapper().orElse(null), col
    ));
origin: speedment/speedment

if (col.getTypeMapper().isPresent()) {
  final String typeMapper = col.getTypeMapper().get();
origin: com.speedment.generator/generator-standard

final boolean isCustomTypeMapper = c.getTypeMapper().isPresent()
  && !TypeMapper.identity().getClass().isAssignableFrom(typeMapperClass)
  && !TypeMapper.primitive().getClass().isAssignableFrom(typeMapperClass);
origin: com.speedment.generator/generator-standard

.filter(c -> c.getTypeMapper()
.filter(tm -> !"".equals(tm))
.filter(tm -> !tm.equals(TypeMapper.identity().getClass().getName()))
origin: com.speedment.generator/generator-standard

if (col.getTypeMapper().isPresent()) {
  final String typeMapper = col.getTypeMapper().get();
com.speedment.runtime.configColumngetTypeMapper

Popular methods of Column

  • findDatabaseType
  • getId
  • getDatabaseType
  • getName
  • getParentOrThrow
  • isNullable
  • mutator
  • getJavaName
  • getEnumConstants
  • getNullableImplementation
  • isAutoIncrement
  • isEnabled
  • isAutoIncrement,
  • isEnabled,
  • getAlias,
  • getAsBoolean,
  • getAsString,
  • getColumnSize,
  • getData,
  • getDecimalDigits,
  • getOrdinalPosition

Popular in Java

  • Reactive rest calls using spring rest template
  • findViewById (Activity)
  • startActivity (Activity)
  • requestLocationUpdates (LocationManager)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Best IntelliJ plugins
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