I am using the same custom TsvectorType with simple entities and even Mapped Superclasses and it works perfectly, however on InheritanceType("JOINED") method convertToDatabaseValueSQL() is never called :/
Hope someone knows how to fix this.
Thank you.

@Fabio thanks for looking into my problem
I attached test where you can detect the problem.

It was quite strange, all i did was changed column that uses custom type to array and some minimal convertToDatabaseValue and convertToDatabaseValueSQL logic and convertToDatabaseValueSQL was never called.

One more thing i noticed, this bug only appears on persist and not on merge.

Kaspars Sproģis
added a comment - 26/Sep/12 4:26 PM - edited @Fabio thanks for looking into my problem
I attached test where you can detect the problem.
It was quite strange, all i did was changed column that uses custom type to array and some minimal convertToDatabaseValue and convertToDatabaseValueSQL logic and convertToDatabaseValueSQL was never called.
One more thing i noticed, this bug only appears on persist and not on merge.
Thanks

Fabio B. Silva
added a comment - 29/Sep/12 5:57 PM Thanks Kaspars
But sorry, I dont get your use case.
Notice that convertToDatabaseValueSQL is called just when using queries to find a object by a especific columns which is your mapping type.
http://docs.doctrine-project.org/en/2.1/cookbook/advanced-field-value-conversion-using-custom-mapping-types.html#the-mapping-type

The only way to update this field in postgresql is to use postgresql function to_tsvector('some text').
And everything works fine, if i persist simple entity, this method transforms insert query as needed:

But when i use inheritance, then by some reason convertToDatabaseValueSQL method is not called and tsv field is updated with simple text as returned by convertToDatabaseValue() method.
I modified the Ticket Test so that you can see exact moment of when it is not called, which is exactly my problem.

Kaspars Sproģis
added a comment - 29/Sep/12 10:15 PM - edited I am using PostgreSQL tsvector data type for full text search.
Here is my tsvector custom data type class:
https://gist.github.com/3129096
The only way to update this field in postgresql is to use postgresql function to_tsvector('some text').
And everything works fine, if i persist simple entity, this method transforms insert query as needed:
public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform)
{
return sprintf('to_tsvector(%s)', $sqlExpr);
}
But when i use inheritance, then by some reason convertToDatabaseValueSQL method is not called and tsv field is updated with simple text as returned by convertToDatabaseValue() method.
I modified the Ticket Test so that you can see exact moment of when it is not called, which is exactly my problem.
Here is the result after persisting (for persist it failed)
$person = new ItemPerson();
$person->setName('some words for test');
$em->persist($person);
$em->flush();
DB Result:
Name | Tsv
--------------------|------------------------------------
some words for test | ' for ' 'some' 'test' 'words'
Here is the result after second time update (now by tsv format you can see it worked):
$person->setName('some more words for test');
$em->flush();
DB Result:
Name | Tsv
--------------------|------------------------------------
some words for test | 'test':5 'word':3