333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
1
{"version":3,"sources":["../../src/find-options/FindOneOptions.ts"],"names":[],"mappings":"","file":"FindOneOptions.js","sourcesContent":["import {JoinOptions} from \"./JoinOptions\";\nimport {ObjectLiteral} from \"../common/ObjectLiteral\";\nimport {FindConditions} from \"./FindConditions\";\n\n/**\n * Defines a special criteria to find specific entity.\n */\nexport interface FindOneOptions<Entity = any> {\n\n    /**\n     * Specifies what columns should be retrieved.\n     */\n    select?: (keyof Entity)[];\n\n    /**\n     * Simple condition that should be applied to match entities.\n     */\n    where?: FindConditions<Entity>[]|FindConditions<Entity>|ObjectLiteral|string;\n\n    /**\n     * Indicates what relations of entity should be loaded (simplified left join form).\n     */\n    relations?: string[];\n\n    /**\n     * Specifies what relations should be loaded.\n     */\n    join?: JoinOptions;\n\n    /**\n     * Order, in which entities should be ordered.\n     */\n    order?: { [P in keyof Entity]?: \"ASC\"|\"DESC\"|1|-1 };\n\n    /**\n     * Enables or disables query result caching.\n     */\n    cache?: boolean | number | { id: any, milliseconds: number };\n\n    /**\n     * Enables or disables query result caching.\n     */\n    lock?: { mode: \"optimistic\", version: number|Date } | { mode: \"pessimistic_read\"|\"pessimistic_write\" };\n\n    /**\n     * If sets to true then loads all relation ids of the entity and maps them into relation values (not relation objects).\n     * If array of strings is given then loads only relation ids of the given properties.\n     */\n    loadRelationIds?: boolean|{ relations?: string[], disableMixedMap?: boolean }; // todo: extract options into separate interface, reuse\n\n    /**\n     * Indicates if eager relations should be loaded or not.\n     * By default they are loaded when find methods are used.\n     */\n    loadEagerRelations?: boolean;\n\n}\n"],"sourceRoot":".."}