Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is array supported? #71

Open
zhaodice opened this issue Jul 8, 2022 · 2 comments
Open

Is array supported? #71

zhaodice opened this issue Jul 8, 2022 · 2 comments

Comments

@zhaodice
Copy link

zhaodice commented Jul 8, 2022

Example:

@Entity
@Table(name="groups")
public class GroupData {

    @Id
    @GeneratedValue
    public long id;

    public long groupId;

    public String groupName;

    public String[] test;

}
@ccleve
Copy link
Member

ccleve commented Jul 28, 2022

What error message do you get when you try it?

@zhaodice
Copy link
Author

zhaodice commented Dec 1, 2022

What error message do you get when you try it?

I am sorry for reply you too late, no error.
but it will create wrong table.
example:

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="groups")
public class GroupData {

    @Id
    @GeneratedValue
    public long id;

    public long groupId;

    public String groupName;

    public String[] test;

}
import com.dieselpoint.norm.Database;

public class run {
    public static void main(String[] args) {
        try {
            Database database = new Database();
            database.setJdbcUrl("jdbc:h2:/tmp/test;database_to_upper=false;TRACE_LEVEL_FILE=0;TRACE_LEVEL_SYSTEM_OUT=0;DB_CLOSE_DELAY=20;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=true");
            database.setUser("sa");
            database.setPassword("");
            database.createTable(GroupData.class);
        } catch (Throwable e) {
            e.printStackTrace();
        }

    }
}

it will do this:

create table groups (id bigint auto_increment,groupId bigint,groupName varchar(255),test varchar(255), primary key (id))

test = varchar(255) ?
it is array! not text...
@ccleve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants