Óɽ«SQL²éѯ½á¹ûת»¯ÎªpojoµÄÏëµ½µÄ
½ñÌìÔÚÍøÉÏÉÏ¿´¼ûһƪ“½«SQL²éѯ½á¹ûת»¯Îªpojo¶ÔÏóµÄ”²©¿Í£¬²©Ö÷×Ô¶¨Òå×öÁËÒ»¸öÀàÈçÏ£º
import java.lang.reflect.Field;
import java.util.List;
import org.hibernate.HibernateException;
import org.hibernate.property.ChainedPropertyAccessor;
import org.hibernate.property.PropertyAccessor;
import org.hibernate.property.PropertyAccessorFactory;
import org.hibernate.property.Setter;
import org.hibernate.transform.ResultTransformer;
/**
* Íê³Énative sql²éѯÊý¾Ý£¨Êý×飩µ½pojo¶ÔÏóµÄת»¯
* @author warison
*
* Oct 26, 2009
*/
public class PojoTransformer implements ResultTransformer {
private static final long serialVersionUID = 1L;
private Class<? extends BaseModel> resultClass;
private Setter[] setters;
private PropertyAccessor propertyAccessor;
public PojoTransformer(Class<? extends BaseModel> resultClass) {
if(resultClass==null)
throw new IllegalArgumentException("resultClass cannot be null");
this.resultClass = resultClass;
propertyAccessor = new ChainedPropertyAccessor(new PropertyAccessor[] { PropertyAccessorFactory.getPropertyAccessor(resultClass,null), PropertyAccessorFactory.getPropertyAccessor("field")});
}
//½á¹ûת»»Ê±£¬HIBERNATEµ÷Óô˷½·¨
&n
Ïà¹ØÎĵµ£º
ת×Ô£ºhttp://hi.baidu.com/arslong/blog/item/b23307e76252342cb8382001.html
Item01
Á¬½Ó×Ö·û´®Öг£ÓõÄÉùÃ÷ÓУº
·þÎñÆ÷ÉùÃ÷£ºData Source
¡¢Server
ºÍAddr
µÈ¡£
Êý¾Ý¿âÉùÃ÷£ºInitial Catalog
ºÍDataBase
µÈ¡£
¼¯³ÉWindows
Õ˺ŵݲȫÐÔÉùÃ÷£ºIntegrated
Security
ºÍTrusted_Connection
µÈ¡£
ʹÓÃÊý¾Ý¿â ......
use AdventureWorks
GO
SELECT c.LastName from Person.Contact c;
SELECT * from HumanResources.Employee e
INNER JOIN HumanResources.Employee m
ON e.ManagerID = m.EmployeeID; n
SELECT ProductID,Name,ProductNumber,ReorderPoint
from Production.Product
where ProductID in( select ProductID fro ......
Microsoft SQL Server ÏÖÔھ߱¸Óë Microsoft Windows .NET Framework µÄ¹«¹²ÓïÑÔÔËÐÐʱ (CLR) ×é¼þ¼¯³ÉµÄ¹¦ÄÜ¡£CLR ΪÍйܴúÂëÌṩ·þÎñ£¬ÀýÈç¿çÓïÑÔ¼¯³É¡¢´úÂë·ÃÎʰ²È«ÐÔ¡¢¶ÔÏóÉú´æÆÚ¹ÜÀíÒÔ¼°µ÷ÊԺͷÖÎöÖ§³Ö¡£¶ÔÓÚ SQL Server Óû§ºÍÓ¦ÓóÌÐò¿ª·¢ÈËÔ±À´Ëµ£¬CLR ¼¯³ÉÒâζ×ÅÄúÏÖÔÚ¿ÉÒÔʹÓÃÈκ ......
. SQL ÃüÁî
Õⲿ·Ö°üº¬ÄÇЩ PostgreSQL Ö§³ÖµÄ SQL ÃüÁîµÄÐÅÏ¢£®ÕâÀïµÄ "SQL" ¾ÍÊǸÃÓïÑÔͨ³£µÄº¬Ò壻 ÿÌõÃüÁîµÄÓë±ê×¼ÓйصļæÈÝÐÔµÄÐÅÏ¢¿ÉÒÔÔÚÏà¹ØµÄ²Î¿¼Ò³ÖÐÕÒµ½£®
Table of Contents
ABORT -- Í˳öµ±Ç°ÊÂÎñ
ALTER GROUP -- Ïò×éÖÐÔö¼ÓÓû§»ò´Ó×éÖÐɾ³ýÓû§
ALTER USER -- ¸Ä±äÊý¾Ý¿â ......
1¡¢ÒªÆôÓÃÈ«ÎÄË÷Òý¹¦ÄÜÊ×ÏÈÐèÒª°²×°full text searchÈ«ÎÄË÷Òý·þÎñ
2¡¢Æô¶¯full text search·þÎñ
3¡¢ÏÈ´´½¨UniqueË÷ÒýºÍÈ«ÎÄË÷Òý£ºCREATE FULLTEXT INDEX ON table_name
4¡¢Ã¿¸ö±íÖ»ÔÊÐí´´½¨Ò»¸öÈ«ÎÄË÷Òý
ɾ³ýÈ«ÎÄË÷Òý DROP FULLTEXT INDEX ON table_name
È«ÎÄËÑË÷Óï¾ä£¬contains(),freeText()
×¢ ......