lib/parser/entity_parser.js
function parse(args) {
  const merged = merge(defaults(), args);
  if (!args || !merged.jdlObject || !args.databaseType) {
    throw new Error('The JDL object and the database type are both mandatory.');
  }
  if (merged.applicationType !== GATEWAY) {
    checkNoSQLModeling(merged.jdlObject, args.databaseType);
  }
  init(merged);
  initializeEntities();
  setOptions();
  fillEntities();
  setApplicationToEntities();
  return entities;
}
function parse(args) {
  const merged = merge(defaults(), args);
  if (!args || !merged.jdlObject || !args.databaseType) {
    throw new Error('The JDL object and the database type are both mandatory.');
  }
  if (merged.applicationType !== GATEWAY) {
    checkNoSQLModeling(merged.jdlObject, args.databaseType);
  }
  init(merged);
  initializeEntities();
  setOptions();
  fillEntities();
  setApplicationToEntities();
  return entities;
}
function parse ( args ) { const merged = merge ( defaults ( ) , args ) ; if ( ! args || ! merged . jdlObject || ! args . databaseType ) { throw new Error ( 'The JDL object and the database type are both mandatory.' ) ; } if ( merged . applicationType !== GATEWAY ) { checkNoSQLModeling ( merged . jdlObject , args . databaseType ) ; } init ( merged ) ; initializeEntities ( ) ; setOptions ( ) ; fillEntities ( ) ; setApplicationToEntities ( ) ; return entities ; }
Converts a JDLObject to ready-to-be exported JSON entities.
@param args the configuration object, keys:
- jdlObject, the JDLObject to convert to JSON
- databaseType
- applicationType
@returns {*} entities that can be exported to JSON.
Converts a JDLObject to ready - to - be exported JSON entities .