Class EntityManager

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(config?: EntityManagerOptions): EntityManager

Parameters

Returns

EntityManager

constructor(config?: string): EntityManager

Parameters

  • config?: string optional

Returns

EntityManager

Properties

public dataService: DataService

public entityChanged: EntityChangedEvent

public hasChangesChanged: HasChangesChangedEvent

public keyGeneratorCtor: Function

public metadataStore: MetadataStore

public queryOptions: QueryOptions

public saveOptions: SaveOptions

public serviceName: string

public validationErrorsChanged: ValidationErrorsChangedEvent

public validationOptions: ValidationOptions

Methods

public addEntity(entity: Entity): Entity

Parameters

Returns

Entity

public attachEntity(entity: Entity, entityState?: EntityStateSymbol): Entity

Parameters

Returns

Entity

public clear()

public createEmptyCopy(): EntityManager

Returns

EntityManager

public createEntity(typeName: string, config?: {}, entityState?: EntityStateSymbol): Entity

Parameters

Returns

Entity

public createEntity(entityType: EntityType, config?: {}, entityState?: EntityStateSymbol): Entity

Parameters

Returns

Entity

public detachEntity(entity: Entity): boolean

Parameters

Returns

boolean

public executeQuery(query: string, callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): Promise

Parameters

Returns

Promise

public executeQuery(query: EntityQuery, callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): Promise

Parameters

Returns

Promise

public executeQueryLocally(query: EntityQuery): Entity[]

Parameters

Returns

Entity[]

public exportEntities(entities?: Entity[], includeMetadata?: boolean): string

Parameters

  • entities?: Entity[] optional
  • includeMetadata?: boolean optional

Returns

string

public fetchEntityByKey(typeName: string, keyValue: any, checkLocalCacheFirst?: boolean): Promise

Parameters

  • typeName: string
  • keyValue: any
  • checkLocalCacheFirst?: boolean optional

Returns

Promise

public fetchEntityByKey(typeName: string, keyValues: Array<any>, checkLocalCacheFirst?: boolean): Promise

Parameters

  • typeName: string
  • keyValues: Array<any>
  • checkLocalCacheFirst?: boolean optional

Returns

Promise

public fetchEntityByKey(entityKey: EntityKey, checkLocalCacheFirst?: boolean): Promise

Parameters

  • entityKey: EntityKey
  • checkLocalCacheFirst?: boolean optional

Returns

Promise

public fetchMetadata(callback?: (schema: any) => void, errorCallback?: ErrorCallback): Promise

Parameters

  • callback?: (schema: any) => void optional
  • errorCallback?: ErrorCallback optional

Returns

Promise

public generateTempKeyValue(entity: Entity): any

Parameters

Returns

any

public getChanges(): Entity[]

Returns

Entity[]

public getChanges(entityTypeName: string): Entity[]

Parameters

  • entityTypeName: string

Returns

Entity[]

public getChanges(entityTypeNames: Array<string>): Entity[]

Parameters

  • entityTypeNames: Array<string>

Returns

Entity[]

public getChanges(entityType: EntityType): Entity[]

Parameters

Returns

Entity[]

public getChanges(entityTypes: EntityType[]): Entity[]

Parameters

Returns

Entity[]

public getEntities(entityTypeName: string, entityState?: EntityStateSymbol): Entity[]

Parameters

Returns

Entity[]

public getEntities(entityTypeNames?: Array<string>, entityState?: EntityStateSymbol): Entity[]

Parameters

Returns

Entity[]

public getEntities(entityTypeName?: string, entityStates?: EntityStateSymbol[]): Entity[]

Parameters

Returns

Entity[]

public getEntities(entityTypeNames?: Array<string>, entityStates?: EntityStateSymbol[]): Entity[]

Parameters

  • entityTypeNames?: Array<string> optional
  • entityStates?: EntityStateSymbol[] optional

Returns

Entity[]

public getEntities(entityType: EntityType, entityState?: EntityStateSymbol): Entity[]

Parameters

Returns

Entity[]

public getEntities(entityTypes?: EntityType[], entityState?: EntityStateSymbol): Entity[]

Parameters

Returns

Entity[]

public getEntities(entityType?: EntityType, entityStates?: EntityStateSymbol[]): Entity[]

Parameters

Returns

Entity[]

public getEntities(entityTypes?: EntityType[], entityStates?: EntityStateSymbol[]): Entity[]

Parameters

Returns

Entity[]

public getEntityByKey(typeName: string, keyValue: any): Entity

Parameters

  • typeName: string
  • keyValue: any

Returns

Entity

public getEntityByKey(typeName: string, keyValues: Array<any>): Entity

Parameters

  • typeName: string
  • keyValues: Array<any>

Returns

Entity

public getEntityByKey(entityKey: EntityKey): Entity

Parameters

Returns

Entity

public hasChanges(): boolean

Returns

boolean

public hasChanges(entityTypeName: string): boolean

Parameters

  • entityTypeName: string

Returns

boolean

public hasChanges(entityTypeNames: Array<string>): boolean

Parameters

  • entityTypeNames: Array<string>

Returns

boolean

public hasChanges(entityType: EntityType): boolean

Parameters

Returns

boolean

public hasChanges(entityTypes: EntityType[]): boolean

Parameters

Returns

boolean

public static importEntities(exportedString: string, config?: { mergeStrategy?: breeze.StrategySymbol; }): EntityManager

Parameters

  • exportedString: string
  • config?: { mergeStrategy?: breeze.StrategySymbol; } optional

Returns

EntityManager

public static importEntities(exportedData: Object, config?: { mergeStrategy?: breeze.StrategySymbol; }): EntityManager

Parameters

  • exportedData: Object
  • config?: { mergeStrategy?: breeze.StrategySymbol; } optional

Returns

EntityManager

public importEntities(exportedString: string, config?: { mergeStrategy?: breeze.StrategySymbol; }): EntityManager

Parameters

  • exportedString: string
  • config?: { mergeStrategy?: breeze.StrategySymbol; } optional

Returns

EntityManager

public importEntities(exportedData: Object, config?: { mergeStrategy?: breeze.StrategySymbol; }): EntityManager

Parameters

  • exportedData: Object
  • config?: { mergeStrategy?: breeze.StrategySymbol; } optional

Returns

EntityManager

public rejectChanges(): Entity[]

Returns

Entity[]

public saveChanges(entities?: Entity[], saveOptions?: SaveOptions, callback?: SaveChangesSuccessCallback, errorCallback?: SaveChangesErrorCallback): Promise

Parameters

Returns

Promise

public setProperties(config: EntityManagerProperties)

Parameters