Manual configuration table name and column in multi field

Hi, guys. I would like to change the automatic name of the table attributes. I change the table name with annotation @joinTable. It works, but I can't change names of other attributes.

XSD schem:


<xsd:element maxOccurs="unbounded" minOccurs="0" name="daysOfWeek" nillable="true" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">@OneToMany
@JoinTable(name="ta_days_of_week",
joinColumns=@JoinColumn(name="test_transaction_id"))</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="daysOfMonth" nillable="true" type="xsd:int" >
<xsd:annotation>
<xsd:appinfo source="appian.jpa">@OneToMany
@JoinTable(name="ta_days_of_month", joinColumns=@JoinColumn(name="test_transaction_id"))</xsd:appinfo>
</xsd:annotation>
</xsd:element>

 

There is generated DDL script (I want to rename 'tatesttrnsctin_daysfmnth_id','ttesttrnsctin_daysfmnth_idx' and 'elt ').

create table `ta_days_of_month` (
`tatesttrnsctin_daysfmnth_id` integer not null,
elt integer,
`ttesttrnsctin_daysfmnth_idx` integer not null,
primary key (`tatesttrnsctin_daysfmnth_id`, `ttesttrnsctin_daysfmnth_idx`)
) ENGINE=InnoDB;

create table `ta_days_of_week` (
`tatesttrnsctin_daysfweek_id` integer not null,
elt varchar(255),
`ttesttrnsctin_daysfweek_idx` integer not null,
primary key (`tatesttrnsctin_daysfweek_id`, `ttesttrnsctin_daysfweek_idx`)
) ENGINE=InnoDB;

  Discussion posts and replies are publicly visible

Parents


  • The way you can control the name of the columns in your link table (in this case it appears that you would like your cdt field to be the integer value associated with your joinColumn), is to add a @column() annotation after your @JoinTable annotation. The @column() will denote which column you would like "returned" as the value associated with your integer array cdt field. Hope that works for you!
Reply


  • The way you can control the name of the columns in your link table (in this case it appears that you would like your cdt field to be the integer value associated with your joinColumn), is to add a @column() annotation after your @JoinTable annotation. The @column() will denote which column you would like "returned" as the value associated with your integer array cdt field. Hope that works for you!
Children
No Data