/** * Set unique for field. */ private void setUnique(FieldMapping fm) { if (_unique.size() == 2) // i.e. TRUE & FALSE getLog().warn(_loc.get("inconsist-col-attrs", fm)); else if (_unique.contains(UniqueFlag.TRUE)) fm.getValueInfo().setUnique(new Unique()); }
private void setUnique(FieldMapping fm, EnumSet<UniqueFlag> unique) { if (unique.size() == 2) // i.e. TRUE & FALSE getLog().warn(_loc.get("inconsist-col-attrs", fm)); else if (unique.contains(UniqueFlag.TRUE)) fm.getValueInfo().setUnique(new Unique()); }
private void setUnique(FieldMapping fm, EnumSet<UniqueFlag> unique) { if (unique.size() == 2) // i.e. TRUE & FALSE getLog().warn(_loc.get("inconsist-col-attrs", fm)); else if (unique.contains(UniqueFlag.TRUE)) fm.getValueInfo().setUnique(new Unique()); }
private void setUnique(FieldMapping fm, EnumSet<UniqueFlag> unique) { if (unique.size() == 2) // i.e. TRUE & FALSE getLog().warn(_loc.get("inconsist-col-attrs", fm)); else if (unique.contains(UniqueFlag.TRUE)) fm.getValueInfo().setUnique(new Unique()); }
/** * Parse discriminator-value. */ private void endDiscriminatorValue() { String val = currentText(); if (StringUtils.isEmpty(val)) return; ClassMapping cm = (ClassMapping) currentElement(); cm.getDiscriminator().getMappingInfo().setValue(val); if (Modifier.isAbstract(cm.getDescribedType().getModifiers()) && getLog().isInfoEnabled()) { getLog().info( _loc.get("discriminator-on-abstract-class", cm .getDescribedType().getName())); } }
/** * Parse discriminator-value. */ private void endDiscriminatorValue() { String val = currentText(); if (StringUtils.isEmpty(val)) return; ClassMapping cm = (ClassMapping) currentElement(); cm.getDiscriminator().getMappingInfo().setValue(val); if (Modifier.isAbstract(cm.getDescribedType().getModifiers()) && getLog().isInfoEnabled()) { getLog().info( _loc.get("discriminator-on-abstract-class", cm .getDescribedType().getName())); } }
/** * Parse discriminator-value. */ private void endDiscriminatorValue() { String val = currentText(); if (StringUtil.isEmpty(val)) return; ClassMapping cm = (ClassMapping) currentElement(); cm.getDiscriminator().getMappingInfo().setValue(val); if (Modifier.isAbstract(cm.getDescribedType().getModifiers()) && getLog().isInfoEnabled()) { getLog().info( _loc.get("discriminator-on-abstract-class", cm .getDescribedType().getName())); } }
/** * Parse discriminator-value. */ private void endDiscriminatorValue() { String val = currentText(); if (StringUtil.isEmpty(val)) return; ClassMapping cm = (ClassMapping) currentElement(); cm.getDiscriminator().getMappingInfo().setValue(val); if (Modifier.isAbstract(cm.getDescribedType().getModifiers()) && getLog().isInfoEnabled()) { getLog().info( _loc.get("discriminator-on-abstract-class", cm .getDescribedType().getName())); } }
Log log = getLog(); if (log.isTraceEnabled()) log.trace(_loc.get("parse-gen", name));
Log log = getLog(); if (log.isTraceEnabled()) log.trace(_loc.get("parse-gen", name));
Log log = getLog(); if (log.isTraceEnabled()) log.trace(_loc.get("parse-gen", name));
Log log = getLog(); if (log.isTraceEnabled()) log.trace(_loc.get("parse-gen", name));
/** * Start processing <code>sql-result-set-mapping</code> node. * Pushes the {@link QueryResultMapping} onto the stack as current element. */ private boolean startSQLResultSetMapping(Attributes attrs) { String name = attrs.getValue("name"); Log log = getLog(); if (log.isTraceEnabled()) log.trace(_loc.get("parse-sqlrsmapping", name)); MappingRepository repos = (MappingRepository) getRepository(); QueryResultMapping result = repos.getCachedQueryResultMapping (null, name); if (result != null && log.isWarnEnabled()) log.warn(_loc.get("override-sqlrsmapping", name, currentLocation())); result = repos.addQueryResultMapping(null, name); result.setListingIndex(_resultIdx++); addComments(result); Object cur = currentElement(); Object scope = (cur instanceof ClassMetaData) ? ((ClassMetaData) cur).getDescribedType() : null; result.setSource(getSourceFile(), scope, SourceTracker.SRC_XML); Locator locator = getLocation().getLocator(); if (locator != null) { result.setLineNumber(locator.getLineNumber()); result.setColNumber(locator.getColumnNumber()); } pushElement(result); return true; }
/** * Start processing <code>sql-result-set-mapping</code> node. * Pushes the {@link QueryResultMapping} onto the stack as current element. */ private boolean startSQLResultSetMapping(Attributes attrs) { String name = attrs.getValue("name"); Log log = getLog(); if (log.isTraceEnabled()) log.trace(_loc.get("parse-sqlrsmapping", name)); MappingRepository repos = (MappingRepository) getRepository(); QueryResultMapping result = repos.getCachedQueryResultMapping (null, name); if (result != null && log.isWarnEnabled()) log.warn(_loc.get("override-sqlrsmapping", name, currentLocation())); result = repos.addQueryResultMapping(null, name); result.setListingIndex(_resultIdx++); addComments(result); Object cur = currentElement(); Object scope = (cur instanceof ClassMetaData) ? ((ClassMetaData) cur).getDescribedType() : null; result.setSource(getSourceFile(), scope, SourceTracker.SRC_XML); Locator locator = getLocation().getLocator(); if (locator != null) { result.setLineNumber(locator.getLineNumber()); result.setColNumber(locator.getColumnNumber()); } pushElement(result); return true; }
/** * Start processing <code>sql-result-set-mapping</code> node. * Pushes the {@link QueryResultMapping} onto the stack as current element. */ private boolean startSQLResultSetMapping(Attributes attrs) { String name = attrs.getValue("name"); Log log = getLog(); if (log.isTraceEnabled()) log.trace(_loc.get("parse-sqlrsmapping", name)); MappingRepository repos = (MappingRepository) getRepository(); QueryResultMapping result = repos.getCachedQueryResultMapping (null, name); if (result != null && log.isWarnEnabled()) log.warn(_loc.get("override-sqlrsmapping", name, currentLocation())); result = repos.addQueryResultMapping(null, name); result.setListingIndex(_resultIdx++); addComments(result); Object cur = currentElement(); Object scope = (cur instanceof ClassMetaData) ? ((ClassMetaData) cur).getDescribedType() : null; result.setSource(getSourceFile(), scope, SourceTracker.SRC_XML); Locator locator = getLocation().getLocator(); if (locator != null) { result.setLineNumber(locator.getLineNumber()); result.setColNumber(locator.getColumnNumber()); } pushElement(result); return true; }
/** * Start processing <code>sql-result-set-mapping</code> node. * Pushes the {@link QueryResultMapping} onto the stack as current element. */ private boolean startSQLResultSetMapping(Attributes attrs) { String name = attrs.getValue("name"); Log log = getLog(); if (log.isTraceEnabled()) log.trace(_loc.get("parse-sqlrsmapping", name)); MappingRepository repos = (MappingRepository) getRepository(); QueryResultMapping result = repos.getCachedQueryResultMapping (null, name); if (result != null && log.isWarnEnabled()) log.warn(_loc.get("override-sqlrsmapping", name, currentLocation())); result = repos.addQueryResultMapping(null, name); result.setListingIndex(_resultIdx++); addComments(result); Object cur = currentElement(); Object scope = (cur instanceof ClassMetaData) ? ((ClassMetaData) cur).getDescribedType() : null; result.setSource(getSourceFile(), scope, result.SRC_XML); pushElement(result); return true; }