» DaoGen Forums
» auto-generated columns and create method
auto-generated columns and create method
Posted by anonymous 06.01.2006 23:06
The doc for the method "public synchronized void create" says:
Also, if this table does not use automatic
* surrogate-keys the primary-key must be specified. After INSERT command this
* method will read the generated primary-key back to valueObject if automatic
* surrogate-keys were used.
How to I enable support for auto-generated primary keys. Should I manually delete the auto-generated column from the create method?
Re: auto-generated columns and create method
Posted by Luigi 10.01.2006 22:43
The comment on create() method is a static string in DaoGen generator, which means it will not change when you change generator options. This is unfortunately true for all comments. Because of this restriction the wording on comments is sometimes not so clear.
In this case, the automatically generated keys-option which the comment refers, is found from the same page that asks the column names. Maybe you have not seen it, since the way different databases do the automatic value generation is different in each database and you will have to select a spesific database server in the first screen to have this option at all.
Just try to select MySQL in the first screen and then see check the option in the second page and proceed to generate code. It is more clear once you see the code and the corresponding create table command.