Hi i’m trying to create my database schema and tables from JPA entities.
I am using an Oracle database.
When i execute the query i get this error:
[2024-05-16 18:32:02] [42000][1918] ORA-01918: user 'users' does not exist.
[2024-05-16 18:32:02] Position: 0
The problem is that i want my “users” to be a SCHEMA instead of a USER and then insert into it the relative “user” table, making the schema and table’s structure like ” users.user”.
This is an example of one of my Entities:
@Entity
@Table(name = "USER", schema = "USERS")
public class User {
@Id
@Column(name = "USERID", nullable = false, length = 15)
private String userid;
@Column(name = "USERNAME", nullable = false, length = 40)
private String username;
...
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
...
}
When i generate the DDL to execute I got an SQL like this:
CREATE TABLE users.user
(
userid VARCHAR2(15) NOT NULL,
username VARCHAR2(40) NOT NULL,
);
Is there a way to make it generating also the “CREATE SCHEMA” statement?