java Annotation Æ´×°SQLÓï¾ä
ÉùÃ÷×Ö¶ÎÓ³Éä
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface FiledRef
{
String fieldName();
}
ÉùÃ÷±íÓ³Éä
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface TableRef
{
String tableName();
}
²âÊÔÀà
@TableRef(tableName = "MobDevice")
public class ReflectTest
{
@FiledRef(fieldName = "ID")
private Long id;
@FiledRef(fieldName = "DEVICE_NAME")
private String name;
@FiledRef(fieldName = "DEVICE_CODE")
private String code;
public ReflectTest(Long id, String name, String code)
{
this.id = id;
this.name = name;
this.code = code;
}
public Long getId()
{
return id;
}
public void setId(Long id)
{
this.id = id;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public String getCode()
{
return code;
}
public void setCode(String code)
{
this.code = code;
}
/**
* @description
* @author zhangml
 
Ïà¹ØÎĵµ£º
ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1 List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......
ÎÄÕ³ö´¦£º http://java.chinaitlab.com/base/807715.html
Java¶ÔÏóÐòÁл¯ÊÇJDK1.1ÖÐÒýÈëµÄÒ»×鿪´´ÐÔÌØÐÔÖ®Ò»£¬Ö®Ç°51CTOÒ²Ôø½éÉܹýJavaÐòÁл¯µÄ»úÖƺÍÔÀí£¬ÕâÀïÎÒÃǽ«Ê¹ÓÃPersonÀ´·¢ÏÖÄú¿ÉÄܲ»ÖªµÀµÄ¹ØÓÚJava¶ÔÏóÐòÁл¯µÄ5¼þÊ¡£
¡¡¡¡Êµ¼ÊÉÏ£¬ÐòÁл¯µÄ˼ÏëÊÇ“¶³½á”¶ÔÏó״̬£¬´«Êä¶ÔÏó״̬£¨Ð´µ½´ÅÅÌ¡¢Í¨¹ý ......
´´½¨´æ´¢¹ý³Ì֮ǰҪÏÈÓÃuseÓï¾äÉùÃ÷Òª½«´æ´¢¹ý³Ì´æ´¢ÔÚÄĸöÊý¾Ý¿âÖÐ. e.g use company; Ö´ÐÐÖ®.Ö®ºó¾Í¿ÉÒÔÉùÃ÷´æ´¢¹ý³ÌÁË. e.g create procedure *** @id varchar(50) , @name int output as select @name=name from table where id=@id È»ºó¿ÉÒÔÓÃalter¶Ô´æ´¢¹ý³Ì½øÐÐÐÞ¸Ä. declare¿ÉÒÔÉùÃ÷Ò»¸ö±äÁ¿ ÓÃset¶Ô±ä ......
1. GROUP BY ÊÇ·Ö×é²éѯ, Ò»°ã GROUP BY ÊǺ;ۺϺ¯ÊýÅäºÏʹÓÃ
group by ÓÐÒ»¸öÔÔò,¾ÍÊÇ select ºóÃæµÄËùÓÐÁÐÖÐ,ûÓÐʹÓþۺϺ¯ÊýµÄÁÐ,±ØÐë³öÏÖÔÚ group by ºóÃ棨ÖØÒª£©
ÀýÈç,ÓÐÈçÏÂÊý¾Ý¿â±í£º
A B
1 abc
1 bcd
1 asdfg
Èç¹ûÓÐÈ ......