Okay, again :)

After my first `ModelCriteria::clear()` fixes this is how `clear()` worked with $modelAlias

```php
$c = new ModelCriteria('bookstore', 'Book', 'alias1');
$c->clear();
echo $c->getModelAlias(); // alias1, correct!
```
but 
```php
$c = BookQuery::create('alias1');
$c->clear();
echo $c->getModelAlias(); // null, something is wrong with create()!
```
Unfortunately initial alias of query created by factory was not preserved after `clear()`, so I've looked at generated base query. It was something like:
```php
abstract class BaseBookQuery extends ModelCriteria
{
    public function __construct($dbName = 'bookstore', $modelName = 'Book', $modelAlias = null)
    {
        parent::__construct($dbName, $modelName, $modelAlias);
    }

    public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof BookQuery) {
            return $criteria;
        }
        $query = new BookQuery();
        if (null !== $modelAlias) {
            $query->setModelAlias($modelAlias);
        }
        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }
}
```
The problem was
```php
        if (null !== $modelAlias) {
            $query->setModelAlias($modelAlias);
        }
```
because $modelAlias was set via setter, query couldn't know that it was initial alias and  `clear()` would turn it into null. So I've modified a query generator a bit:
```php
    public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof BookQuery) {
            return $criteria;
        }
        $query = new BookQuery('bookstore', 'Book', $modelAlias);
//        $query = new BookQuery();
//        if (null !== $modelAlias) {
//            $query->setModelAlias($modelAlias);
//        }

        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }
```
the code below started to work
```php
$c = BookQuery::create('alias1');
$c->clear();
echo $c->getModelAlias(); // 'alias1', correct!
```
But hardcoding $dbName and $modelName
```php
        $query = new BookQuery('bookstore', 'Book', $modelAlias);
```
had one huge drawback, if someone customized their BookQuery like that
```php
class BookQuery extends BaseBookQuery
{
    // note modified $modelName
    public function __construct($dbName = 'bookstore', $modelName = 'ExtendedBook', $modelAlias = null)
    {
        parent::__construct($dbName, $modelName, $modelAlias);
    }
}
```
it would stop to work - my code broke BC. So I've refactored generator one more time
```php
// this is current code in repo
abstract class BaseBookQuery extends ModelCriteria
{
    public function __construct($dbName = null, $modelName = null, $modelAlias = null)
//    public function __construct($dbName = 'bookstore', $modelName = 'Book', $modelAlias = null)
    {
        if (null === $dbName) {
            $dbName = 'bookstore';
        }
        if (null === $modelName) {
            $modelName = 'Book';
        }
        parent::__construct($dbName, $modelName, $modelAlias);
    }

    public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof BookQuery) {
            return $criteria;
        }
        $query = new BookQuery(null, null, $modelAlias);
//        $query = new BookQuery('bookstore', 'Book', $modelAlias);

        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }
}
```
et voila - works like a charm and is as backward compatible as it can get.