diff --git a/src/models/layerMetadata/decorators/class/catalogDBEntity.decorator.ts b/src/models/layerMetadata/decorators/class/catalogDBEntity.decorator.ts index 9a0987d..5af7d85 100644 --- a/src/models/layerMetadata/decorators/class/catalogDBEntity.decorator.ts +++ b/src/models/layerMetadata/decorators/class/catalogDBEntity.decorator.ts @@ -4,6 +4,7 @@ const catalogDbEntityMetadataKey = Symbol('catalogdbentitymapping'); export interface ICatalogDBEntityMapping { table: string; // database table name + className: string; } export function catalogDBEntity(catalogdbentitymapping: ICatalogDBEntityMapping): ClassDecorator { diff --git a/src/models/layerMetadata/decorators/property/catalogDB.decorator.ts b/src/models/layerMetadata/decorators/property/catalogDB.decorator.ts index fab5764..b8a3eac 100644 --- a/src/models/layerMetadata/decorators/property/catalogDB.decorator.ts +++ b/src/models/layerMetadata/decorators/property/catalogDB.decorator.ts @@ -7,9 +7,9 @@ export interface IColumnProps { name?: string; type: string; nullable?: boolean; - defaultValue?: string; - isPrimary?: boolean; - isIndexed?: boolean; + default?: string; + primary?: boolean; + unique?: boolean; spatialFeatureType?: string; srid?: number; } diff --git a/src/models/layerMetadata/index.ts b/src/models/layerMetadata/index.ts index 72c671c..df60bf5 100644 --- a/src/models/layerMetadata/index.ts +++ b/src/models/layerMetadata/index.ts @@ -5,6 +5,7 @@ export { IShpMapping, ShapeFileType } from './decorators/property/shp.decorator' export { TsTypes, IDescribeTsType, PropertiesTypes } from './decorators/property/tsTypes.decorator'; export { IPYCSWMapping } from './decorators/property/csw.decorator'; export { IColumnProps } from './decorators/property/catalogDB.decorator'; +export { ICatalogDBEntityMapping } from './decorators/class/catalogDBEntity.decorator'; export { IOrmCatalog } from '../common/interfaces/ormCatalog.interface'; export * from './pycswLayerCatalogRecord'; diff --git a/src/models/layerMetadata/layer3DMetadata.ts b/src/models/layerMetadata/layer3DMetadata.ts index efcafa1..2619f79 100644 --- a/src/models/layerMetadata/layer3DMetadata.ts +++ b/src/models/layerMetadata/layer3DMetadata.ts @@ -235,7 +235,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel { column: { name: 'producer_name', type: 'text', - defaultValue: 'IDFMU', + default: 'IDFMU', nullable: true, }, }) diff --git a/src/models/layerMetadata/layerMetadata.ts b/src/models/layerMetadata/layerMetadata.ts index e2bad42..a912525 100644 --- a/src/models/layerMetadata/layerMetadata.ts +++ b/src/models/layerMetadata/layerMetadata.ts @@ -238,7 +238,7 @@ export class LayerMetadata implements ILayerMetadata, IMetadataCommonModel { column: { name: 'producer_name', type: 'text', - defaultValue: 'IDFMU', + default: 'IDFMU', nullable: true, }, }) diff --git a/src/models/layerMetadata/pycsw3DCatalogRecord.ts b/src/models/layerMetadata/pycsw3DCatalogRecord.ts index 8258cee..fe13bb7 100644 --- a/src/models/layerMetadata/pycsw3DCatalogRecord.ts +++ b/src/models/layerMetadata/pycsw3DCatalogRecord.ts @@ -12,6 +12,7 @@ import { Layer3DMetadata, IPropPYCSWMapping } from './layer3DMetadata'; @catalogDBEntity({ table: 'records', + className: 'Metadata', }) @graphqlClass({ alias: 'Layer3DRecord' }) export class Pycsw3DCatalogRecord extends Layer3DMetadata implements IPycswCoreModel, IOrmCatalog { diff --git a/src/models/layerMetadata/pycswLayerCatalogRecord.ts b/src/models/layerMetadata/pycswLayerCatalogRecord.ts index 4af5110..a4b5d25 100644 --- a/src/models/layerMetadata/pycswLayerCatalogRecord.ts +++ b/src/models/layerMetadata/pycswLayerCatalogRecord.ts @@ -12,6 +12,7 @@ import { getPyCSWMapping, pycsw } from './decorators/property/csw.decorator'; @catalogDBEntity({ table: 'records', + className: 'RecordEntity', }) @graphqlClass({ alias: 'LayerRasterRecord' }) export class PycswLayerCatalogRecord extends LayerMetadata implements IPycswCoreModel, IOrmCatalog { @@ -27,6 +28,7 @@ export class PycswLayerCatalogRecord extends LayerMetadata implements IPycswCore name: 'identifier', type: 'text', nullable: false, + primary: true, }, }) @tsTypes({