| 322 | } |
| 323 | |
| 324 | static _findAutoIncrementAttribute() { |
| 325 | this.autoIncrementAttribute = null; |
| 326 | |
| 327 | for (const name in this.rawAttributes) { |
| 328 | if (Object.prototype.hasOwnProperty.call(this.rawAttributes, name)) { |
| 329 | const definition = this.rawAttributes[name]; |
| 330 | if (definition && definition.autoIncrement) { |
| 331 | if (this.autoIncrementAttribute) { |
| 332 | throw new Error('Invalid Instance definition. Only one autoincrement field allowed.'); |
| 333 | } |
| 334 | this.autoIncrementAttribute = name; |
| 335 | } |
| 336 | } |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | static _conformIncludes(options, self) { |
| 341 | if (!options.include) return; |