开发者社区> 问答> 正文

运行过程中碰到的几个小问题?报错

执行这一段时,报错

new User().set("username", "test")

Could not found ModelMetadata for this model:cn.dreampie.example.model.User


另外这个user,不知道怎么注入,还望指导下

@POST("/users") public User save(User user) {
  User u = new User().set("username", "test").set("providername", "test").set("password", "123456");
  user = userService.save(u); return user;
}


展开
收起
爱吃鱼的程序员 2020-06-14 18:11:03 526 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    你得配置ActiveRecordPlugin,最好再加上连接池,继承model的类需要数据库orm映射,你看看resty-example里面的config下的AppConfig的数据库配置<divclass="ref">

    引用来自“王仁辉(java)”的评论

    你得配置ActiveRecordPlugin,最好再加上连接池,继承model的类需要数据库orm映射,你看看resty-example里面的config下的AppConfig的数据库配置<divclass="ref">

    引用来自“孙小心”的评论

    <divclass="ref">

    引用来自“王仁辉(java)”的评论

    你得配置ActiveRecordPlugin,最好再加上连接池,继承model的类需要数据库orm映射,你看看resty-example里面的config下的AppConfig的数据库配置路六级

    AppConfig.java


    importcn.dreampie.orm.provider.c3p0.C3p0DataSourceProvider;

    这个类不存在

    2020-06-14 18:11:20
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
面向失败设计 立即下载
小程序 大世界 立即下载
《15分钟打造你自己的小程序》 立即下载