/**
  *
  * @param \DOMNode $xmlNode
  * @return \blaze\persistence\meta\OneToManyDescriptor 
  */
 private function parseManyToOne(\DOMNode $xmlNode)
 {
     $manyToOne = new \blaze\persistence\meta\SingleFieldDescriptor();
     $manyToOne->setName($xmlNode->getAttribute('name'));
     $manyToOne->setType(\blaze\persistence\meta\ClassDescriptor::getClassDescriptor($xmlNode->getAttribute('class'))->getName());
     $column = new \blaze\persistence\meta\ColumnDescriptor();
     $column->setName($xmlNode->getAttribute('column'));
     $manyToOne->setColumnDescriptor($column);
     return $manyToOne;
 }
 /**
  *
  * @param \DOMDocument $doc
  * @param \DOMElement $elem
  * @param blaze\collections\ListI[blaze\ds\meta\ColumnMetaData] $columns
  */
 private function reverseForeignColumns(\blaze\persistence\meta\ClassDescriptor $elem, $columns)
 {
     $usedNames = array();
     foreach ($columns as $column) {
         $foreignConstraint = null;
         foreach ($column->getConstraints() as $constraint) {
             if ($constraint instanceof \blaze\ds\meta\ForeignKeyMetaData) {
                 $foreignConstraint = $constraint;
                 break;
             }
         }
         $field = new \blaze\persistence\meta\SingleFieldDescriptor();
         $name = $this->getMemberName($foreignConstraint->getReferencedColumn()->getTable()->getTableName());
         if (array_key_exists($name, $usedNames)) {
             $name .= $usedNames[$name]++;
         } else {
             $usedNames[$name] = 0;
         }
         $field->setName($name);
         $field->setType($this->package . '\\' . $this->getClassName($foreignConstraint->getReferencedColumn()->getTable()->getTableName()));
         $col = new \blaze\persistence\meta\ColumnDescriptor();
         $col->apply($column);
         $field->setColumnDescriptor($col);
         $elem->addSingleField($field);
     }
 }