首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > Java > easyjpadao -轻松的创建你的DAO层

easyjpadao -轻松的创建你的DAO层

  • 资源大小:8.81 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: java dao persistence jpa

资 源 简 介

What ? EasyDao is a generic dao for jpa implementation for persistence unit. Enjoy How to use follow an example using easyjpadao: ``` import java.util.List; import sislocar.beans.Cidade; import com.easyjpadao.GenericDao; public class main { public static void main(String[] args) { //create an object that will make CRUD methods using a name of the persistence unit GenericDao genericdao = new GenericDao("WebSisLoCarPU",null); Cidade cidade = new Cidade(); //inserting cidade.setIdCidade(160); cidade.setNome("New York"); cidade.setUf("NY"); //the method to insert genericdao.insert(cidade); //updating cidade.setIdCidade(2); cidade.setNome("Sao Paulo"); cidade.setUf("SP"); //the method to update genericdao.update(cidade); //deleting by id (this example will delete the New York city genericdao.deleteById(cidade,
VIP VIP
0.171316s