jhipster-core
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -24,3 +24,4 @@ 'use strict'; | ||
IMAGE_BLOB: 'ImageBlob', | ||
TEXT_BLOB: 'TextBlob' | ||
TEXT_BLOB: 'TextBlob', | ||
INSTANT: 'Instant' | ||
}; | ||
@@ -41,3 +42,4 @@ const SQL_VALIDATIONS = { | ||
ImageBlob: new Set([VALIDATIONS.REQUIRED, VALIDATIONS.MINBYTES, VALIDATIONS.MAXBYTES]), | ||
TextBlob: new Set([VALIDATIONS.REQUIRED, VALIDATIONS.MINBYTES, VALIDATIONS.MAXBYTES]) | ||
TextBlob: new Set([VALIDATIONS.REQUIRED, VALIDATIONS.MINBYTES, VALIDATIONS.MAXBYTES]), | ||
Instant: new Set([VALIDATIONS.REQUIRED]) | ||
}; | ||
@@ -58,3 +60,4 @@ const MONGODB_TYPES = { | ||
IMAGE_BLOB: 'ImageBlob', | ||
TEXT_BLOB: 'TextBlob' | ||
TEXT_BLOB: 'TextBlob', | ||
INSTANT: 'Instant' | ||
}; | ||
@@ -75,3 +78,4 @@ const MONGODB_VALIDATIONS = { | ||
ImageBlob: new Set([VALIDATIONS.REQUIRED, VALIDATIONS.MINBYTES, VALIDATIONS.MAXBYTES]), | ||
TextBlob: new Set([VALIDATIONS.REQUIRED, VALIDATIONS.MINBYTES, VALIDATIONS.MAXBYTES]) | ||
TextBlob: new Set([VALIDATIONS.REQUIRED, VALIDATIONS.MINBYTES, VALIDATIONS.MAXBYTES]), | ||
Instant: new Set([VALIDATIONS.REQUIRED]) | ||
}; | ||
@@ -87,3 +91,4 @@ const CASSANDRA_TYPES = { | ||
DATE: 'Date', | ||
UUID: 'UUID' | ||
UUID: 'UUID', | ||
INSTANT: 'Instant' | ||
}; | ||
@@ -99,3 +104,4 @@ const CASSANDRA_VALIDATIONS = { | ||
Date: new Set([VALIDATIONS.REQUIRED]), | ||
UUID: new Set([VALIDATIONS.REQUIRED]) | ||
UUID: new Set([VALIDATIONS.REQUIRED]), | ||
Instant: new Set([VALIDATIONS.REQUIRED]) | ||
}; | ||
@@ -102,0 +108,0 @@ function isSQLType(type) { |
@@ -14,2 +14,3 @@ 'use strict'; | ||
IllegalName: null, | ||
IllegalOption: null, | ||
InvalidObject: null, | ||
@@ -16,0 +17,0 @@ MalformedAssociation: null, |
@@ -14,2 +14,3 @@ 'use strict'; | ||
FieldTypes = require('../core/jhipster/field_types'), | ||
DatabaseTypes = require('../core/jhipster/database_types'), | ||
formatComment = require('../utils/format_utils').formatComment, | ||
@@ -42,3 +43,3 @@ isReservedClassName = require('../core/jhipster/reserved_keywords').isReservedClassName, | ||
fillAssociations(); | ||
fillOptions(); | ||
fillOptions(passedDatabaseType); | ||
return jdlObject; | ||
@@ -192,5 +193,5 @@ } | ||
function fillOptions() { | ||
function fillOptions(passedDatabaseType) { | ||
fillUnaryOptions(); | ||
fillBinaryOptions(); | ||
fillBinaryOptions(passedDatabaseType); | ||
} | ||
@@ -237,5 +238,9 @@ | ||
function fillBinaryOptions() { | ||
function fillBinaryOptions(passedDatabaseType) { | ||
_.forEach(BinaryOptions.BINARY_OPTIONS, (optionValue) => { | ||
_.forEach(document[optionValue], (documentOptionValue, documentOptionKey) => { | ||
if (optionValue === BinaryOptions.BINARY_OPTIONS.PAGINATION | ||
&& passedDatabaseType === DatabaseTypes.Types.cassandra) { | ||
throw new buildException(exceptions.IllegalOption, "Pagination isn't allowed when the app uses Cassandra."); | ||
} | ||
addOption(optionValue, documentOptionKey); | ||
@@ -242,0 +247,0 @@ }); |
{ | ||
"name": "jhipster-core", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "JHipster's own domain language and core objects", | ||
@@ -42,5 +42,5 @@ "main": "module/index.js", | ||
"chai": "3.5.0", | ||
"eslint": "3.18.0", | ||
"eslint": "3.19.0", | ||
"istanbul": "0.4.5", | ||
"mocha": "3.2.0", | ||
"mocha": "3.3.0", | ||
"mocha-clean": "1.0.0", | ||
@@ -47,0 +47,0 @@ "pegjs": "0.10.0" |
@@ -568,4 +568,14 @@ 'use strict'; | ||
}); | ||
describe('when having a cassandra app with paginated entities', () => { | ||
const input = parseFromFiles(['./test/test_files/cassandra_jdl.jdl']); | ||
it('fails', () => { | ||
try { | ||
JDLParser.parse(input, 'cassandra'); | ||
} catch (error) { | ||
expect(error.name).to.eq('IllegalOptionException'); | ||
} | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
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
539776
13572