org.apache.cayenne.merge

## Class SetColumnTypeToModel

- java.lang.Object
- - org.apache.cayenne.merge.AbstractToModelToken
  - - org.apache.cayenne.merge.SetColumnTypeToModel

- All Implemented Interfaces:
    MergerToken

      public class SetColumnTypeToModel
      extends AbstractToModelToken

  A `MergerToken` that modifies one original `DbAttribute` to match another new `DbAttribute`s type, maxLength and precision. The name and mandatory fields are not modified by this token.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SetColumnTypeToModel(DbEntity entity, DbAttribute columnOriginal, DbAttribute columnNew)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MergerToken` | `createReverse(MergerFactory factory)` Create a token with the reverse direction.
    `void` | `execute(MergerContext mergerContext)`
    `DbAttribute` | `getColumnNew()`
    `DbAttribute` | `getColumnOriginal()`
    `DbEntity` | `getEntity()`
    `String` | `getTokenName()`
    `String` | `getTokenValue()`

    - ### Methods inherited from class org.apache.cayenne.merge.AbstractToModelToken

      `getDirection, objEntitiesMappedToDbEntity, remove, remove, synchronizeWithObjEntity, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### SetColumnTypeToModel

          public SetColumnTypeToModel(DbEntity entity,
                              DbAttribute columnOriginal,
                              DbAttribute columnNew)

  - ### Method Detail

    - #### createReverse

          public MergerToken createReverse(MergerFactory factory)

      Description copied from interface: `MergerToken`
      Create a token with the reverse direction. AddColumn in one direction becomes DropColumn in the other direction.

      Not all tokens are reversible.

    - #### execute

          public void execute(MergerContext mergerContext)

    - #### getTokenName

          public String getTokenName()

    - #### getTokenValue

          public String getTokenValue()

      Specified by:
        `getTokenValue` in interface `MergerToken`

    - #### getColumnOriginal

          public DbAttribute getColumnOriginal()

    - #### getColumnNew

          public DbAttribute getColumnNew()

    - #### getEntity

          public DbEntity getEntity()

Copyright © 2001–2014 Apache Cayenne. All rights reserved.