SQLÓïÑԵIJ¼¾ÖºÍIllegalArgumentException
ºÍjava.lang.IllegalArgumentException: org.hibernate.QueryException: JPA-style positional param was not an integral ordinalÕ½¶·Á˰ëÌ죬º¹°¡£¡
ʹÓÃjpa + strut+ hibernate ¾Í±¨org.hibernate.QueryException: JPA-style positional param was not an integral ordinal
Ò»°ã°ÑhqlÓï¾äдÔÚÒ»ÐУ¬»áºÜ³¤£¬ÔÚideÖÐÐèÒªÍ϶¯¹ö¶¯Ìõ²ÅÄܲ鿴¡£ÎªÁË·½±ãÔĶÁ£¬¹Ê¸Ä³É¼¸ÐУº
public List<Resource> getResourceByTag(Tag tag,int start) {
Query query = entityManager.createQuery(
"SELECT r from Resource r WHERE ?1" +
"IN (SELECT t from r.res_tags t)" +
"ORDER BY r.res_update_date DESC");
query.setParameter(1, tag);
query.setFirstResult(start);
query.setMaxResults(Constants.ITEMS_PER_PAGE);
return query.getResultList();
}
È»ºó¾Í±¨´íava.lang.IllegalArgumentException: org.hibernate.QueryException: JPA-style positional param was not an integral ordinal¡£
°¡°¡°¡°¡°¡°¡£¬sqlÖÐÉÙÁ˺ü¸¸ö¿Õ¸ñ£¬¾ÍÔÚ»»Ðеĵط½
ÕýÈ·£º
"from Resource r WHERE ?1 " +
"IN (from r.res_tags) " +
"ORDER BY r.res_update_date DESC");
ÎÞÄεĽÌѵ£¡
Ïà¹ØÎĵµ£º
-->Title:Generating test data
-->Author:wufeng4552
-->Date :2009-09-25 09:56:07
if object_id('tb')is not null drop table tb
go
create table tb(ID int,name text)
insert tb select 1,'test'
go
--·½·¨1
select sql_variant_property(ID,'BaseType') from tb
--·½·¨2
select object_name(ID)± ......
/********************************
¹¦ÄÜ£º»ñÈ¡±íµÄ¿Õ¼ä·Ö²¼Çé¿ö
**********************************/
if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tablespaceinfo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
create table tablespaceinfo   ......
ÈçºÎÐÞ¸ÄSQL ServerµÄÁ¬½ÓÊý
ÎÒ°ÑSQL Server 7.0µÄÓû§Á¬½ÓÊýÉèΪ1ºó£¬Êý¾Ý¿â¾ÍÔÙÒ²Á¬²»ÉÏÁË£¬ËùÒÔҲû°ì·¨ÐÞ¸ÄÁ¬½ÓÊý
ÇëÎÊÓÐʲô°ì·¨ÄÜÐÞ¸ÄÁ¬½ÓÊý£¿
ÔÚserver µÄÊôÐÔÀïÃæÓиöconnetctions µÄ
maximun concurr ......