src/com/dream/service/impl/MovePServiceImpl.java
(完整代码) 1KBpackage com.dream.service.impl;
import javax.persistence.Query;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.dream.bean.MoveP;
import com.dream.dao.DaoSupport;
import com.dream.service.MovePService;
@Service
@Transactional
public class MovePServiceImpl extends DaoSupport implements MovePService {
public void deleteMoveP(Long[] ids){
if(ids!=null&&ids.length>0){
StringBuffer jpql = new StringBuffer();
for(int i=0;i<ids.length;i++){
jpql.append("?").append(i+1).append(",");
}
jpql.deleteCharAt(jpql.length()-1);
Query query = em.createQuery("delete from MoveP o where o.id in("+jpql.toString()+")");
for(int i=0;i<ids.length;i++){
query.setParameter(i+1, ids[i]);
}
query.executeUpdate();
}
}
@Transactional(readOnly=true,propagation=Propagation.NOT_SUPPORTED)
public MoveP findByName(String name){
Query query = em.createQuery("select o from MoveP o where o.name=?1");
query.setParameter(1, name);
return (MoveP)query.getSingleResult();
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。