ActFramework 集成BeetlSql 遇到的问题

在使用ActFramework框架时,使用BeetlSql操作mysql数据库,遇到了以下问题:

1、@AutoID注解的字段在数据库中必须是自动增长的,否则会报如下错误:

Server Error
 - org.beetl.sql.core.BeetlSQLException: java.sql.SQLException: Field 'preorder_id' doesn't have a default value
2、@Table注解的包应该是
org.beetl.sql.core.annotatoin.Table

import act.db.DB;

import org.beetl.sql.core.annotatoin.Table;
import org.beetl.sql.core.mapper.BaseMapper;

@DB("mysql")
@Table(name = "order_preorder")
public class OrderPreOrder{

    private String preorderId; // 预订单ID

    public String getPreorderId() {
        return preorderId;
    }

    public void setPreorderId(String preorderId) {
        this.preorderId = preorderId;
    }

    public interface Mapper extends BaseMapper {

    }
}
如果是 javax.persistence.Table这个包,则会报以下错误:

Server Error
 - org.beetl.sql.core.BeetlSQLException: table "OrderPreOrder" not exist



你可能感兴趣的:(ActFramework,BeetlSQL)