jhipster-core
Advanced tools
Comparing version 1.1.5 to 1.1.6
@@ -28,3 +28,3 @@ 'use strict'; | ||
entityNames.slice(1, entityNames.length - 1); | ||
var firstPart = `${this.name} ${entityNames} with ${this.value}`; | ||
var firstPart = `${this.name === BINARY_OPTIONS.BINARY_OPTIONS.PAGINATION ? 'paginate' : this.name} ${entityNames} with ${this.value}`; | ||
if (this.excludedNames.size() === 0) { | ||
@@ -31,0 +31,0 @@ return firstPart; |
@@ -45,3 +45,4 @@ 'use strict'; | ||
getId() { | ||
return `${this.type}_${this.from.name}${(this.injectedFieldInFrom) ? `{${this.injectedFieldInFrom}}` : ''}_${this.to.name}${(this.injectedFieldInTo) ? `{${this.injectedFieldInTo}}` : ''}`; | ||
return `${this.type}_${this.from.name}${(this.injectedFieldInFrom) ? `{${this.injectedFieldInFrom}}` : ''}` | ||
+ `_${this.to.name}${(this.injectedFieldInTo) ? `{${this.injectedFieldInTo}}` : ''}`; | ||
} | ||
@@ -48,0 +49,0 @@ |
@@ -24,4 +24,4 @@ 'use strict'; | ||
function isReservedTableName(keyword, databaseType) { | ||
return (databaseType.toLowerCase() === 'sql') | ||
? isReserved(keyword, 'mysql') || isReserved(keyword, 'postgresql') || isReserved(keyword, 'oracle') | ||
return (databaseType.toUpperCase() === 'SQL') | ||
? isReserved(keyword, 'MYSQL') || isReserved(keyword, 'POSTGRESQL') || isReserved(keyword, 'ORACLE') | ||
: isReserved(keyword, databaseType); | ||
@@ -28,0 +28,0 @@ } |
@@ -58,3 +58,5 @@ 'use strict'; | ||
if (isReservedClassName(enumObj.name)) { | ||
throw new buildException(exceptions.IllegalName, `The name '${enumObj.name}' is reserved keyword and can not be used as enum class name.`); | ||
throw new buildException( | ||
exceptions.IllegalName, | ||
`The name '${enumObj.name}' is reserved keyword and can not be used as enum class name.`); | ||
} | ||
@@ -73,7 +75,11 @@ jdlObject.addEnum(new JDLEnum({ | ||
if (isReservedClassName(entity.name)) { | ||
throw new buildException(exceptions.IllegalName, `The name '${entity.name}' is reserved keyword and can not be used as entity class name.`); | ||
throw new buildException( | ||
exceptions.IllegalName, | ||
`The name '${entity.name}' is reserved keyword and can not be used as entity class name.`); | ||
} | ||
let tableName = entity.tableName || entity.name; | ||
if (isReservedTableName(tableName, passedDatabaseType)) { | ||
throw new buildException(exceptions.IllegalName, `The name '${tableName}' is reserved keyword and can not be used as entity table name.`); | ||
throw new buildException( | ||
exceptions.IllegalName, | ||
`The name '${tableName}' is reserved keyword and can not be used as entity table name.`); | ||
} | ||
@@ -91,3 +97,3 @@ jdlObject.addEntity({ | ||
}); | ||
if (relationToUser && !jdlObject.entities[USER]) { | ||
if (relationToUser && relationToUser.length && !jdlObject.entities[USER]) { | ||
jdlObject.addEntity({ | ||
@@ -110,3 +116,5 @@ name: USER, | ||
if (isReservedFieldName(fieldName, passedDatabaseType)) { | ||
throw new buildException(exceptions.IllegalName, `The name '${fieldName}' is reserved keyword and can not be used as entity field name.`); | ||
throw new buildException( | ||
exceptions.IllegalName, | ||
`The name '${fieldName}' is reserved keyword and can not be used as entity field name.`); | ||
} | ||
@@ -113,0 +121,0 @@ if (jdlObject.enums[field.type] || isType(field.type)) { |
{ | ||
"name": "jhipster-core", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "JHipster's own domain language and core objects", | ||
@@ -35,7 +35,7 @@ "main": "module/index.js", | ||
"dependencies": { | ||
"lodash": "4.14.1" | ||
"lodash": "4.14.2" | ||
}, | ||
"devDependencies": { | ||
"pegjs": "0.9.0", | ||
"mocha": "3.0.1", | ||
"mocha": "3.0.2", | ||
"chai": "3.5.0", | ||
@@ -42,0 +42,0 @@ "istanbul": "0.4.4" |
@@ -243,4 +243,9 @@ 'use strict'; | ||
expect(option.toString()).to.eq(`${BINARY_OPTIONS.DTO} D, E, F with ${BINARY_OPTION_VALUES.dto.MAPSTRUCT} except A, B, C`); | ||
option = new JDLBinaryOption({ | ||
name: BINARY_OPTIONS.PAGINATION, | ||
value: BINARY_OPTION_VALUES.pagination.PAGER | ||
}); | ||
expect(option.toString()).to.eq(`paginate * with ${BINARY_OPTION_VALUES.pagination.PAGER}`); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
406454
10848
+ Addedlodash@4.14.2(transitive)
- Removedlodash@4.14.1(transitive)
Updatedlodash@4.14.2