| 299 | } |
| 300 | |
| 301 | static _findAutoIncrementAttribute() { |
| 302 | this.autoIncrementAttribute = null; |
| 303 | |
| 304 | for (const name in this.rawAttributes) { |
| 305 | if (Object.prototype.hasOwnProperty.call(this.rawAttributes, name)) { |
| 306 | const definition = this.rawAttributes[name]; |
| 307 | if (definition && definition.autoIncrement) { |
| 308 | if (this.autoIncrementAttribute) { |
| 309 | throw new Error(class="st">'Invalid Instance definition. Only one autoincrement field allowed.'); |
| 310 | } |
| 311 | this.autoIncrementAttribute = name; |
| 312 | } |
| 313 | } |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | static _conformIncludes(options, self) { |
| 318 | if (!options.include) return; |