/** * Process a <code>column-result</code> node. */ private boolean startColumnResult(Attributes attrs) throws SAXException { QueryResultMapping parent = (QueryResultMapping) currentElement(); parent.addColumnResult(attrs.getValue("name")); return true; }
/** * Process a <code>column-result</code> node. */ private boolean startColumnResult(Attributes attrs) throws SAXException { QueryResultMapping parent = (QueryResultMapping) currentElement(); parent.addColumnResult(attrs.getValue("name")); return true; }
/** * Parse join-table. */ private boolean startJoinTable(Attributes attrs) throws SAXException { String table = toTableName(attrs.getValue("schema"), attrs.getValue("name")); if (table != null) ((FieldMapping) currentElement()).getMappingInfo().setTableName (table); return true; }
/** * Parse table. */ private boolean startTable(Attributes attrs) throws SAXException { String table = toTableName(attrs.getValue("schema"), attrs.getValue("name")); if (table != null) ((ClassMapping) currentElement()).getMappingInfo().setTableName (table); return true; }
/** * Process a <code>field-result</code> node. */ private boolean startFieldResult(Attributes attrs) throws SAXException { String fieldName = attrs.getValue("name"); String columnName = DBIdentifier.newColumn(attrs.getValue("column"), delimit()).getName(); QueryResultMapping.PCResult parent = (QueryResultMapping.PCResult) currentElement(); parent.addMapping(fieldName, columnName); return true; }
/** * Process a <code>field-result</code> node. */ private boolean startFieldResult(Attributes attrs) throws SAXException { String fieldName = attrs.getValue("name"); String columnName = DBIdentifier.newColumn(attrs.getValue("column"), delimit()).getName(); QueryResultMapping.PCResult parent = (QueryResultMapping.PCResult) currentElement(); parent.addMapping(fieldName, columnName); return true; }
/** * Process a <code>field-result</code> node. */ private boolean startFieldResult(Attributes attrs) throws SAXException { String fieldName = attrs.getValue("name"); String columnName = DBIdentifier.newColumn(attrs.getValue("column"), delimit()).getName(); QueryResultMapping.PCResult parent = (QueryResultMapping.PCResult) currentElement(); parent.addMapping(fieldName, columnName); return true; }
/** * Parse map-key-enumerated. */ private void endMapKeyEnumerated() { String text = currentText(); if (StringUtil.isEmpty(text)) return; EnumType type = Enum.valueOf(EnumType.class, text); FieldMapping fm = (FieldMapping) currentElement(); String strat = EnumValueHandler.class.getName() + "(StoreOrdinal=" + String.valueOf(type == EnumType.ORDINAL) + ")"; fm.getKeyMapping().getValueInfo().setStrategy(strat); }
/** * Start tracking secondary table information and columns */ private boolean startSecondaryTable(Attributes attrs) throws SAXException { _secondaryTable = toTableIdentifier(attrs.getValue("schema"), attrs.getValue("name")).getName(); ((ClassMapping)currentElement()).getMappingInfo() .addSecondaryTable(DBIdentifier.newTable(_secondaryTable)); return true; }
/** * Set the secondary table information back to the owning class mapping. */ private void endSecondaryTable() { ClassMapping cm = (ClassMapping) currentElement(); ClassMappingInfo info = cm.getMappingInfo(); info.setSecondaryTableJoinColumns(_secondaryTable, _joinCols); clearSecondaryTableInfo(); }
/** * Ends processing <unique-constraint> provided the tag occurs * within a ClassMapping element and <em>not</em> within a secondary * table. The stack is popped and the Unique element is added to the * ClassMappingInfo. */ private void endUniqueConstraint() { Unique unique = (Unique) popElement(); Object current = currentElement(); if (current instanceof ClassMapping && _secondaryTable == null) ((ClassMapping) current).getMappingInfo().addUnique(unique); }
private boolean endName() { String name = this.currentText(); if (StringUtils.isNotEmpty(name)) { Object current = currentElement(); if (current instanceof Unique) { Unique unq = (Unique)current; unq.setIdentifier(DBIdentifier.newConstraint(name, delimit())); } } return true; }
/** * Start tracking secondary table information and columns */ private boolean startSecondaryTable(Attributes attrs) throws SAXException { _secondaryTable = toTableIdentifier(attrs.getValue("schema"), attrs.getValue("name")).getName(); ((ClassMapping)currentElement()).getMappingInfo() .addSecondaryTable(DBIdentifier.newTable(_secondaryTable)); return true; }
/** * Parse table. */ private boolean startTable(Attributes attrs) throws SAXException { ClassMapping mapping = (ClassMapping) currentElement(); if (mapping.isAbstract()) throw new UserException(_loc.get("table-not-allowed", mapping)); DBIdentifier table = toTableIdentifier(attrs.getValue("schema"), attrs.getValue("name")); if (!DBIdentifier.isNull(table)) mapping.getMappingInfo().setTableIdentifier(table); return true; }
/** * Parse table. */ private boolean startTable(Attributes attrs) throws SAXException { ClassMapping mapping = (ClassMapping) currentElement(); if (mapping.isAbstract()) throw new UserException(_loc.get("table-not-allowed", mapping)); DBIdentifier table = toTableIdentifier(attrs.getValue("schema"), attrs.getValue("name")); if (!DBIdentifier.isNull(table)) mapping.getMappingInfo().setTableIdentifier(table); return true; }
/** * Set the secondary table information back to the owning class mapping. */ private void endSecondaryTable() { ClassMapping cm = (ClassMapping) currentElement(); ClassMappingInfo info = cm.getMappingInfo(); info.setSecondaryTableJoinColumns(DBIdentifier.newTable(_secondaryTable, delimit()), _joinCols); clearSecondaryTableInfo(); }
private boolean endName() { String name = this.currentText(); if (StringUtil.isNotEmpty(name)) { Object current = currentElement(); if (current instanceof Unique) { Unique unq = (Unique)current; unq.setIdentifier(DBIdentifier.newConstraint(name, delimit())); } } return true; }
private boolean endName() { String name = this.currentText(); if (StringUtil.isNotEmpty(name)) { Object current = currentElement(); if (current instanceof Unique) { Unique unq = (Unique)current; unq.setIdentifier(DBIdentifier.newConstraint(name, delimit())); } } return true; }
/** * Set the secondary table information back to the owning class mapping. */ private void endSecondaryTable() { ClassMapping cm = (ClassMapping) currentElement(); ClassMappingInfo info = cm.getMappingInfo(); info.setSecondaryTableJoinColumns(DBIdentifier.newTable(_secondaryTable, delimit()), _joinCols); clearSecondaryTableInfo(); }
/** * Set the join table information back. */ private void endJoinTable() { FieldMapping fm = (FieldMapping) currentElement(); if (_joinCols != null) fm.getMappingInfo().setColumns(_joinCols); if (_cols != null) fm.getElementMapping().getValueInfo().setColumns(_cols); clearColumnInfo(); }