Rooftop
Jul 6th, 2009, 03:57 PM
Hi,
I am having problems persisting this class, in fact mysql product_group table cannot be created. It is related to this mysql topic:
http://forums.mysql.com/read.php?22,19755,19755#msg-19755
Console output:
Unsuccessful: create table product_group (id bigint not null auto_increment, version integer, index varchar(255), postfix bigint, prefix bigint, primary key (id))
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(255), postfix bigint, prefix bigint, primary key (id))' at line 1
Unsuccessful: alter table product add index FKED8DCCEF701A29C6 (productgroup), add constraint FKED8DCCEF701A29C6 foreign key (productgroup) references product_group (id)
Can't create table '.\roo-a\#sql-468_20.frm' (errno: 150)
Unsuccessful: alter table product_group add index FK51F3772F1087ADAA (prefix), add constraint FK51F3772F1087ADAA foreign key (prefix) references prefix (id)
Table 'roo-a.product_group' doesn't exist
Unsuccessful: alter table product_group add index FK51F3772FF7C82724 (postfix), add constraint FK51F3772FF7C82724 foreign key (postfix) references postfix (id)
Table 'roo-a.product_group' doesn't exist
@Entity
@RooEntity
@RooJavaBean
@RooToString
public class ProductGroup {
@NotNull
@Size(min = 4, max = 4)
private String index;
@ManyToOne
@JoinColumn
private Prefix prefix;
@ManyToOne
@JoinColumn
private Postfix postfix;
}
Jira/mysql/Hibernate issue?
Another question, how can i stop roo from creating a new db every time i restart tc-server, or is this related to the above issue?
Regards,
Ronald Vermeire
I am having problems persisting this class, in fact mysql product_group table cannot be created. It is related to this mysql topic:
http://forums.mysql.com/read.php?22,19755,19755#msg-19755
Console output:
Unsuccessful: create table product_group (id bigint not null auto_increment, version integer, index varchar(255), postfix bigint, prefix bigint, primary key (id))
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(255), postfix bigint, prefix bigint, primary key (id))' at line 1
Unsuccessful: alter table product add index FKED8DCCEF701A29C6 (productgroup), add constraint FKED8DCCEF701A29C6 foreign key (productgroup) references product_group (id)
Can't create table '.\roo-a\#sql-468_20.frm' (errno: 150)
Unsuccessful: alter table product_group add index FK51F3772F1087ADAA (prefix), add constraint FK51F3772F1087ADAA foreign key (prefix) references prefix (id)
Table 'roo-a.product_group' doesn't exist
Unsuccessful: alter table product_group add index FK51F3772FF7C82724 (postfix), add constraint FK51F3772FF7C82724 foreign key (postfix) references postfix (id)
Table 'roo-a.product_group' doesn't exist
@Entity
@RooEntity
@RooJavaBean
@RooToString
public class ProductGroup {
@NotNull
@Size(min = 4, max = 4)
private String index;
@ManyToOne
@JoinColumn
private Prefix prefix;
@ManyToOne
@JoinColumn
private Postfix postfix;
}
Jira/mysql/Hibernate issue?
Another question, how can i stop roo from creating a new db every time i restart tc-server, or is this related to the above issue?
Regards,
Ronald Vermeire