Esempio n. 1
0
  /**
   * Construct a new field descriptor for the specified field.
   *
   * @param fieldName The field name
   * @param typeInfo The field type information
   * @param handler The field handler (may be null)
   * @param trans True if the field is transient
   */
  public JDOFieldDescriptorImpl(
      final String fieldName,
      final TypeInfo typeInfo,
      final FieldHandler handler,
      final boolean trans,
      final String[] sqlName,
      final int[] sqlType,
      final String manyTable,
      final String[] manyKey,
      final boolean dirtyCheck,
      final boolean readonly) {
    super();

    if (fieldName == null) {
      throw new IllegalArgumentException("Argument 'fieldName' is null");
    }

    if (handler == null) {
      throw new IllegalArgumentException("Argument 'fieldDesc' has no handler");
    }

    setFieldName(fieldName);
    setFieldType(typeInfo.getFieldType());
    setHandler(handler);
    setTransient(trans);
    setImmutable(typeInfo.isImmutable());
    setRequired(typeInfo.isRequired());
    setMultivalued(typeInfo.getCollectionHandler() != null);

    _convertor = typeInfo.getConvertorFrom();
    _sqlName = (sqlName.length == 0 ? null : sqlName);
    _sqlType = sqlType;
    _manyTable = manyTable;
    _manyKey = (manyKey.length > 0 ? manyKey : null);
    _dirtyCheck = dirtyCheck;
    _readonly = readonly;
  }