Composite Key with Hibernate

后端 未结 4 740
死守一世寂寞
死守一世寂寞 2021-02-15 06:45

In order to generate the next SQL code:

create table users (
    user_name varchar(15) not null primary key, 
    user_pass varchar(15) not null);

create table         


        
4条回答
  •  暖寄归人
    2021-02-15 07:14

    I add to the answer of Chris Winters, but using foreign keys in order to implement it. You can write:

    
        
        
    
    

    This will do the job and also take care of foreign keys, and will give you the flexibility to define by yourself which tables are created in the database by Hibernate.

提交回复
热议问题