protected static function buildPointers(MetaClass $class)
    {
        $out = null;
        if (!$class->getPattern() instanceof AbstractClassPattern) {
            if ($source = $class->getSourceLink()) {
                $out .= <<<EOT
\tprotected \$linkName =  '{$source}';
\t

EOT;
            }
            if ($class->getIdentifier()->getColumnName() !== 'id') {
                $out .= <<<EOT
public function getIdName()
{
\treturn '{$class->getIdentifier()->getColumnName()}';
}

EOT;
            }
            $out .= <<<EOT
public function getTable()
{
\treturn '{$class->getTableName()}';
}

public function getObjectName()
{
\treturn '{$class->getName()}';
}

public function getSequence()
{
\treturn '{$class->getTableName()}_id';
}
EOT;
        } elseif ($class->getWithInternalProperties()) {
            $out .= <<<EOT
// no get{Table,ObjectName,Sequence} for abstract class
EOT;
        }
        if ($liaisons = $class->getReferencingClasses()) {
            $uncachers = array();
            foreach ($liaisons as $className) {
                $uncachers[] = $className . '::dao()->uncacheLists();';
            }
            $uncachers = implode("\n", $uncachers);
            $out .= <<<EOT


public function uncacheLists()
{
{$uncachers}

return parent::uncacheLists();
}
EOT;
        }
        return $out;
    }
    private static function dumpMetaClass(MetaClass $class)
    {
        $propertyList = $class->getWithInternalProperties();
        $out = <<<EOT
\tprotected function makePropertyList()
\t{

EOT;
        if ($class->hasBuildableParent()) {
            $out .= <<<EOT
\t\treturn
\t\t\tarray_merge(
\t\t\t\tparent::makePropertyList(),
\t\t\t\tarray(

EOT;
            if ($class->getIdentifier()) {
                $propertyList[$class->getIdentifier()->getName()] = $class->getIdentifier();
            }
        } else {
            $out .= <<<EOT
\t\treturn array(

EOT;
        }
        $list = array();
        foreach ($propertyList as $property) {
            $list[] = "'{$property->getName()}' => " . $property->toLightProperty($class)->toString();
        }
        $out .= implode(",\n", $list);
        if ($class->hasBuildableParent()) {
            $out .= "\n)";
        }
        $out .= <<<EOT

\t\t);
\t}
EOT;
        return $out;
    }
 /**
  * @return MetaConfiguration
  **/
 private function checkSanity(MetaClass $class)
 {
     if ((!$class->getParent() || $class->getFinalParent()->getPattern() instanceof InternalClassPattern) && !$class->getPattern() instanceof ValueObjectPattern && !$class->getPattern() instanceof InternalClassPattern) {
         Assert::isTrue($class->getIdentifier() !== null, 'only value objects can live without identifiers. ' . 'do not use them anyway (' . $class->getName() . ')');
     }
     if ($class->getType() && $class->getTypeId() == MetaClassType::CLASS_SPOOKED) {
         Assert::isFalse(count($class->getProperties()) > 1, 'spooked classes must have only identifier: ' . $class->getName());
         Assert::isTrue($class->getPattern() instanceof SpookedClassPattern || $class->getPattern() instanceof SpookedEnumerationPattern, 'spooked classes must use spooked patterns only: ' . $class->getName());
     }
     foreach ($class->getProperties() as $property) {
         if (!$property->getType()->isGeneric() && $property->getType() instanceof ObjectType && $property->getType()->getClass()->getPattern() instanceof ValueObjectPattern) {
             Assert::isTrue($property->isRequired(), 'optional value object is not supported:' . $property->getName() . ' @ ' . $class->getName());
             Assert::isTrue($property->getRelationId() == MetaRelation::ONE_TO_ONE, 'value objects must have OneToOne relation: ' . $property->getName() . ' @ ' . $class->getName());
         } elseif ($property->getFetchStrategyId() == FetchStrategy::LAZY && $property->getType()->isGeneric()) {
             throw new WrongArgumentException('lazy one-to-one is supported only for ' . 'non-generic object types ' . '(' . $property->getName() . ' @ ' . $class->getName() . ')');
         }
     }
     return $this;
 }