Add default value to column


stephane
 

I would like to add the default value of a field to the database column definition, in order to have the SchemaTool generating it in the database.

I tried like in the doc, but without success:
<mapping-file>META-INF/orm-mysql.xml</mapping-file>
 <basic name="currency">
            <column name="CURRENCY" default-value="GBP"/>
        </basic>

any suggestion ?

--
Stephane


Andy
 

Why not decide if you are using JDO mapping files or not? You seem to be trying to use JPA format for an attribute that is only defined for JDO.
The doc doesn't make any mention of "default-value". With JPA you have to dump it all into "column-definition".


stephane
 

On Fri, Jan 29, 2021 at 10:08 AM, Andy wrote:
Why not decide if you are using JDO mapping files or not? You seem to be trying to use JPA format for an attribute that is only defined for JDO.
The doc doesn't make any mention of "default-value". With JPA you have to dump it all into "column-definition".
thanks Andy, I probably mixed up the mapping... my bad...

Why not the JDO, for many bad reasons... 
 
--
Stephane