<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[Heck's  Blog]]></title> 
<link>https://www.heckjj.com/index.php</link> 
<description><![CDATA[一瞬间的决定，往往可以改变很多，事实上，让自己成功的往往不是知识，是精神！ 如果你总是为自己找借口，那只好让成功推迟。执行力，今天！]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[Heck's  Blog]]></copyright>
<item>
<link>https://www.heckjj.com/java-use-ejb30-sql/</link>
<title><![CDATA[如何在EJB 3.0中使用SQL查询]]></title> 
<author>Heck &lt;@hecks.tk&gt;</author>
<category><![CDATA[编程杂谈]]></category>
<pubDate>Mon, 20 Sep 2010 15:17:32 +0000</pubDate> 
<guid>https://www.heckjj.com/java-use-ejb30-sql/</guid> 
<description>
<![CDATA[ 
	<span style="font-family: 微软雅黑;">请看下面这段代码演示了如何在ejb 3中使用参数化的SQL查询：</span><br/><textarea name="code" class="java" rows="15" cols="100">protected EntityManager manager;
String ejbqlDelete = "delete from ClientTicket p where " + 
&nbsp;&nbsp; "p.closed = :paramClosed and " + 
&nbsp;&nbsp; "p.department = :paramDepartment and " + 
&nbsp;&nbsp; "p.ticketUserID = :paramTicketUserID and " + 
&nbsp;&nbsp; "p.ticketName = :paramTicketName";

int deletedEntities = manager.createQuery(ejbqlDelete).
&nbsp;&nbsp; setParameter("paramClosed", Boolean.TRUE).
&nbsp;&nbsp; setParameter( "paramDepartment", adminid).
&nbsp;&nbsp; setParameter( "paramTicketUserID", userID ).
&nbsp;&nbsp; setParameter( "paramTicketName", delTicket ).
&nbsp;&nbsp; executeUpdate();</textarea><br/>Tags - <a href="https://www.heckjj.com/tags/%25E5%258F%2582%25E6%2595%25B0%25E5%258C%2596%25E6%259F%25A5%25E8%25AF%25A2/" rel="tag">参数化查询</a> , <a href="https://www.heckjj.com/tags/ejb/" rel="tag">ejb</a> , <a href="https://www.heckjj.com/tags/3/" rel="tag">3</a> , <a href="https://www.heckjj.com/tags/sql/" rel="tag">sql</a>
]]>
</description>
</item><item>
<link>https://www.heckjj.com/java-use-ejb30-sql/#blogcomment</link>
<title><![CDATA[[评论] 如何在EJB 3.0中使用SQL查询]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://www.heckjj.com/java-use-ejb30-sql/#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>