Note that there are some explanatory texts on larger screens.

plurals
  1. POMany to one entity using JPA
    primarykey
    data
    text
    <p>I am trying to create an entity for the table structure given belos</p> <pre><code>(id, name, task, leader_id) </code></pre> <p>this table gives the information about the team users for the particular task and their leader for the team.</p> <p>I wrote the entity like this</p> <pre><code>@Column(name = "id", insertable = false, nullable = false, updatable = true) private Integer id; @Col umn(name = "name", nullable = false) private String tokenName; @Column(name = "task", nullable = false) private String task; @ManyToOne(cascade = ALL, fetch = LAZY) @JoinColumn(name = "leader_id") private User leader; </code></pre> <p>I created the ddl through hibernate3:hbm2ddl and it looks like this</p> <pre><code>alter table user drop foreign key FK60FD5D6395C4EEC2; drop table if exists user; create table user ( id integer not null auto_increment, task varchar(255), name varchar(255) not null, leader_id integer, primary key (id) ); alter table user add index FK60FD5D6395C4EEC2 (leader_id), add constraint FK60FD5D6395C4EEC2 foreign key (leader_id) references user (id); </code></pre> <p>while exporting this schema through maven-sql-plugin, I am getting the following error</p> <pre><code>[ERROR] Failed to execute: alter table user drop foreign key FK60FD5D6395C4EEC2 [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Column "FOREIGN" not found; SQL statement: alter table user drop foreign key FK60FD5D6395C4EEC2 [42122-158] </code></pre> <p>Where I am doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload