It's not that naive as you might think. Actually it generates only a directory structure with files with no code only a 'use base ...' declaration and a database description. I think the regeneration after a schema change can be made safe - that is it only needs to overwrite the database description and eventually add new classes but it does not need to overwrite the hand written code.