private CatalogField(Catalog catalog, KKey kKey, KKeyMetadata metadata, CatalogFieldType fieldType = CatalogFieldType.DATA) { this.Catalog = catalog; this.KKey = kKey; this.Metadata = metadata; this.Type = fieldType; FIELDS_BY_KEY.Add(kKey, this); }
public bool Equals(Object obj) { if (this == obj) { return(true); } if (obj == null) { return(false); } if (!(obj is KKeyMetadata)) { return(false); } KKeyMetadata other = (KKeyMetadata)obj; if (columnName == null) { if (other.columnName != null) { return(false); } } else if (!columnName.Equals(other.columnName)) { return(false); } if (dataType == null) { if (other.dataType != null) { return(false); } } else if (dataType != other.dataType) { return(false); } if (length == null) { if (other.length != null) { return(false); } } else if (length != other.length) { return(false); } if (saveToDb != other.saveToDb) { return(false); } return(true); }
/** * Gets {@link KKeyMetadata metadata} of this K-key * * @return */ public KKeyMetadata getMetadata() { if (metadata == null) { metadata = findMetadata(); if (metadata == null) { LOG.error("Can't find metadata for k-key: " + key); return(null); } } return(metadata); }
/// <summary> /// See {@link KKeyMetadata#getConverter()} /// </summary> /// <returns></returns> public IKKeyValueConverter getConverter() { if (metadata == null) { metadata = findMetadata(); } if (metadata?.Converter == null) { LOG.error("Can't find converter for k-key: " + key); return(null); } else { return(metadata.Converter); } }
/** * See {@link KKeyMetadata#getDataType()} * * @return */ public Class <?> getDataType() { if (metadata == null) { metadata = findMetadata(); } if (metadata == null || metadata.DataType == null) { LOG.error("Can't find data type of k-key: " + key); return(null); } else { return(metadata.DataType); } }
/** * See {@link KKeyMetadata#getColumnName()} * * @return */ public String getDbColumnName() { if (metadata == null) { metadata = findMetadata(); } if (metadata?.ColumnName == null) { LOG.error("Can't find DB column name for k-key: " + key); return(null); } else { return(metadata.ColumnName); } }