query.html
来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 543 行 · 第 1/2 页
HTML
543 行
<DT><B>Returns:</B><DD>the result<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/persistence/NoResultException.html" title="class in javax.persistence">NoResultException</A></CODE> - if there is no result<DD><CODE><A HREF="../../javax/persistence/NonUniqueResultException.html" title="class in javax.persistence">NonUniqueResultException</A></CODE> - if more than one result<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if called for a Java Persistence query language UPDATE or DELETE statement</DL></DD></DL><HR><A NAME="executeUpdate()"><!-- --></A><H3>executeUpdate</H3><PRE>int <B>executeUpdate</B>()</PRE><DL><DD>Execute an update or delete statement.<P><DD><DL><DT><B>Returns:</B><DD>the number of entities updated or deleted<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if called for a Java Persistence query language SELECT statement<DD><CODE><A HREF="../../javax/persistence/TransactionRequiredException.html" title="class in javax.persistence">TransactionRequiredException</A></CODE> - if there is no transaction</DL></DD></DL><HR><A NAME="setMaxResults(int)"><!-- --></A><H3>setMaxResults</H3><PRE><A HREF="../../javax/persistence/Query.html" title="interface in javax.persistence">Query</A> <B>setMaxResults</B>(int maxResult)</PRE><DL><DD>Set the maximum number of results to retrieve.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>maxResult</CODE> - <DT><B>Returns:</B><DD>the same query instance<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if argument is negative</DL></DD></DL><HR><A NAME="setFirstResult(int)"><!-- --></A><H3>setFirstResult</H3><PRE><A HREF="../../javax/persistence/Query.html" title="interface in javax.persistence">Query</A> <B>setFirstResult</B>(int startPosition)</PRE><DL><DD>Set the position of the first result to retrieve.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>startPosition</CODE> - the start position of the first result, numbered from 0<DT><B>Returns:</B><DD>the same query instance<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if argument is negative</DL></DD></DL><HR><A NAME="setHint(java.lang.String, java.lang.Object)"><!-- --></A><H3>setHint</H3><PRE><A HREF="../../javax/persistence/Query.html" title="interface in javax.persistence">Query</A> <B>setHint</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> hintName, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> value)</PRE><DL><DD>Set an implementation-specific hint. If the hint name is not recognized, it is silently ignored.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>hintName</CODE> - <DD><CODE>value</CODE> - <DT><B>Returns:</B><DD>the same query instance<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the second argument is not valid for the implementation</DL></DD></DL><HR><A NAME="setParameter(java.lang.String, java.lang.Object)"><!-- --></A><H3>setParameter</H3><PRE><A HREF="../../javax/persistence/Query.html" title="interface in javax.persistence">Query</A> <B>setParameter</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> value)</PRE><DL><DD>Bind an argument to a named parameter.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the parameter name<DD><CODE>value</CODE> - <DT><B>Returns:</B><DD>the same query instance<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if parameter name does not correspond to parameter in query string or argument is of incorrect type</DL></DD></DL><HR><A NAME="setParameter(java.lang.String, java.util.Date, javax.persistence.TemporalType)"><!-- --></A><H3>setParameter</H3><PRE><A HREF="../../javax/persistence/Query.html" title="interface in javax.persistence">Query</A> <B>setParameter</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Date.html" title="class or interface in java.util">Date</A> value, <A HREF="../../javax/persistence/TemporalType.html" title="enum in javax.persistence">TemporalType</A> temporalType)</PRE><DL><DD>Bind an instance of java.util.Date to a named parameter.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - <DD><CODE>value</CODE> - <DD><CODE>temporalType</CODE> - <DT><B>Returns:</B><DD>the same query instance<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if parameter name does not correspond to parameter in query string</DL></DD></DL><HR><A NAME="setParameter(java.lang.String, java.util.Calendar, javax.persistence.TemporalType)"><!-- --></A><H3>setParameter</H3><PRE><A HREF="../../javax/persistence/Query.html" title="interface in javax.persistence">Query</A> <B>setParameter</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Calendar.html" title="class or interface in java.util">Calendar</A> value, <A HREF="../../javax/persistence/TemporalType.html" title="enum in javax.persistence">TemporalType</A> temporalType)</PRE><DL><DD>Bind an instance of java.util.Calendar to a named parameter.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - <DD><CODE>value</CODE> - <DD><CODE>temporalType</CODE> - <DT><B>Returns:</B><DD>the same query instance<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if parameter name does not correspond to parameter in query string</DL></DD></DL><HR><A NAME="setParameter(int, java.lang.Object)"><!-- --></A><H3>setParameter</H3><PRE><A HREF="../../javax/persistence/Query.html" title="interface in javax.persistence">Query</A> <B>setParameter</B>(int position, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> value)</PRE><DL><DD>Bind an argument to a positional parameter.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>position</CODE> - <DD><CODE>value</CODE> - <DT><B>Returns:</B><DD>the same query instance<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if position does not correspond to positional parameter of query or argument is of incorrect type</DL></DD></DL><HR><A NAME="setParameter(int, java.util.Date, javax.persistence.TemporalType)"><!-- --></A><H3>setParameter</H3><PRE><A HREF="../../javax/persistence/Query.html" title="interface in javax.persistence">Query</A> <B>setParameter</B>(int position, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Date.html" title="class or interface in java.util">Date</A> value, <A HREF="../../javax/persistence/TemporalType.html" title="enum in javax.persistence">TemporalType</A> temporalType)</PRE><DL><DD>Bind an instance of java.util.Date to a positional parameter.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>position</CODE> - <DD><CODE>value</CODE> - <DD><CODE>temporalType</CODE> - <DT><B>Returns:</B><DD>the same query instance<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if position does not correspond to positional parameter of query</DL></DD></DL><HR><A NAME="setParameter(int, java.util.Calendar, javax.persistence.TemporalType)"><!-- --></A><H3>setParameter</H3><PRE><A HREF="../../javax/persistence/Query.html" title="interface in javax.persistence">Query</A> <B>setParameter</B>(int position, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Calendar.html" title="class or interface in java.util">Calendar</A> value, <A HREF="../../javax/persistence/TemporalType.html" title="enum in javax.persistence">TemporalType</A> temporalType)</PRE><DL><DD>Bind an instance of java.util.Calendar to a positional parameter.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>position</CODE> - <DD><CODE>value</CODE> - <DD><CODE>temporalType</CODE> - <DT><B>Returns:</B><DD>the same query instance<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if position does not correspond to positional parameter of query</DL></DD></DL><HR><A NAME="setFlushMode(javax.persistence.FlushModeType)"><!-- --></A><H3>setFlushMode</H3><PRE><A HREF="../../javax/persistence/Query.html" title="interface in javax.persistence">Query</A> <B>setFlushMode</B>(<A HREF="../../javax/persistence/FlushModeType.html" title="enum in javax.persistence">FlushModeType</A> flushMode)</PRE><DL><DD>Set the flush mode type to be used for the query execution. The flush mode type applies to the query regardless of the flush mode type in use for the entity manager.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>flushMode</CODE> - </DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../javax/persistence/PrimaryKeyJoinColumns.html" title="annotation in javax.persistence"><B>PREV CLASS</B></A> <A HREF="../../javax/persistence/QueryHint.html" title="annotation in javax.persistence"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?javax/persistence/Query.html" target="_top"><B>FRAMES</B></A> <A HREF="Query.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../legal/license.html" target="_top">license terms.</a></font></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?