Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
Telosys Tools 专为此类任务而设计
它从数据库模型生成代码
请参阅https://sites.google.com/site/telosystools/
您可以使用本教程的一部分https://sites.google.com/site/telosystutorial/springmvc-jpa-springdatajpa 仅生成 JPA 部分
您还可以创建自己的模板以满足您自己的需求(或调整现有模板)
Telosys Tools is designed for this kind of task
It generates code from the database model
See https://sites.google.com/site/telosystools/
You can use a part of this tutorial https://sites.google.com/site/telosystutorial/springmvc-jpa-springdatajpa to generate only the JPA part
You can also create your own templates in order to match you own needs (or adapt existing templates)
你可以使用泛型和反射来制作类似的东西
}
方法 public void setClase(Class clase);让一切变得神奇,所以如果你需要查询 x 那么你设置类,并且 getAll() 的实现将是
}
you could use generics and reflection to make something like that
}
the method public void setClase(Class clase); make all de magic so if you need to query to x then you set the class and the implementaton for example of getAll() will be
}
查看 Spring-Data-JPA 或 Spring ROO
Take a look at Spring-Data-JPA or Spring ROO