HibernateÓëSQLµÄÑ¡Ôñ
HibernateÊÇÒ»¿îÓÅÐãµÄORM¹¤¾ß¡£µ«ÊÇÔÚijЩÇé¿öÏÂÄÑÃâ»á¸øÎÒÃǵÄÏîÄ¿´øÀ´Ò»¶¨µÄ¸´ÔÓÐÔ¡£¾ÍËãʹÓÃspring×öÒ»¶¨µÄÊÂÎñ¼ò»¯£¬¸Ä±äµÄÒ²½ö½öÊDZàдµÄʱºò¸ü¼ÓµÄ¼òµ¥¶øÒÑ¡£ÌرðÊÇÔÚ´¦Àí²éѯµÄʱºò£¬hibernateºÍsql±È½ÏÆðÀ´£¬¾ÍËƺõûÓÐÄÇô´óµÄÓÅÊÆÁË¡£ËùÒÔÔںܶàµÄÏîÄ¿ÀïÃæÔÚʹÓÃhibernateºÍspringµÄͬʱ»¹»áʹÓÃibatisµÄsqlmap¡£
ÄÇʲôʱºòʹÓÃhibernate±È½ÏºÏÊÊÄØ?Õâ¸öºÍÎÒÃǵÄÉè¼ÆÓкܴóµÄ¹Øϵ¡£hibernateÊǽâ¾ö¶ÔÏó´æ´¢µÄÎÊÌâµÄ£¬ËµµÄͨË×Ò»µã£¬¾ÍÊǸù¾ÝÎÒÃÇÉè¼ÆµÄ¶ÔÏóϵͳÀ´ÌæÎÒÃÇÉú³ÉsqlÓï¾äµÄ¡£ËùÒÔÈç¹ûÎÒÃǵÄϵͳÊÇÒ»ÖÖ¸´ÔÓµÄÒµÎñϵͳ£¬²¢²»ÐèÒª´óÁ¿µÄÊÂÎñ´¦ÀíºÍ¸´ÔӵIJéѯµÄ»°¡£ÎÒ¾õµÃ³¹µ×µÄʹÓÃhibernateÊDZȽϺõÄÑ¡Ôñ¡£ÕâÑùÎÒÃÇ¿ÉÒÔ¼¯Öо«Á¦ÔÚÒµÎñµÄ´¦ÀíÉÏ¡£µ±È»£¬ÎÒ¾õµÃÕâÖÖÇé¿ö²»Ì«»á³öÏÖ¡£´ó¶àÊýµÄÒµÎñϵͳ¶¼²»»áÓи´ÔӵĶÔÏó½á¹¹¡£ÎÒÔÙ˵µÄͨË×Ò»µã£¬¾Í¿´ÎÒÃǵÄÒµÎñÀïÃ棬ÊÇ×¢ÖØÊý¾Ý´¦Àí»¹ÊÇ×¢ÖØÂß¼·½ÃæµÄ´¦Àí£¬Ç°ÕßÊDz»Ì«ÊʺÏhibernateµÄ¡£ºóÕ߱ȽÏÊʺϡ£Èç¹ûÊÇ»ìºÏµÄϵͳµÄ£¬ÎÒ¾õµÃÁ½Õ߶¼ÊÇÐèÒªµÄ£¬·Ö±ðÍê³É¸÷×ÔµÄÈÎÎñ¡£ÓÐЩÈË¿ÉÄܲ»ÕâÑùÈÏΪ£¬¾õµÃ×Ô¼ºµÄˮƽ×ã¹»¸ß¿ÉÒÔÓÃhibernate½â¾öÒ»ÇеÄÎÊÌ⣬µ«ÊÇÎÒ¾õµÃ£¬ÕâÊÇÒ»ÖÖÆ«¼¤µÄÏë·¨£¬ÒòΪÎÒ¾õµÃûÓÐÒøµ¯£¬Ò²Ã»Óлƽ𴸣¬ÊÀ½çÉÏûÓÐÍòÄܵĶ«Î÷£¬Ñ¡ÔñºÏÊʵŤ¾ßÈ¥½â¾öÏàÓ¦µÄÎÊÌ⣬²ÅÊÇÒ»ÖÖÇÐʵµÄ̬¶È¡£²»ÄÜ×·ÇóÐÎʽÉϵÄÍêÃÀ¡£
Ïà¹ØÎĵµ£º
×÷ΪһÃûÊý¾Ý¿âDBA£¬¿Ï¶¨»áÌý˵¹ý“tempdbÊý¾Ý¿âÂúÁË”¡£Í¨³£ÎÒÃǺÜÈÝÒ×È·¶¨Ôì³ÉÕâÒ»ÎÊÌâµÄÔÒò¡£µ«ÊǸü¶àµÄʱºòÕâÒ»ÎÊÌâÖ÷ÒªÔ´ÓÚÒ»×éÇëÇó£¬Éæ¼°µ½Ð´úÂ벿Êð»òÖð½¥Ôö¼ÓµÄÊý¾Ý¡£
¡¡¡¡“TempdbÂúÁË”Òâζ×Åʲô?
¡¡¡¡µ±SQL Server tempdbÂúÁËʱ£¬Éϲã¹ÜÀí³£³£ÐèÒª¾ö²ß¡¢Ò»Ð©¿ª·¢ÈËÔ±¿ÉÄÜ»áÍÆжÔðÈΣ¬¾ ......
SELECT A,B=stuff((select ' ' + '×Ö¶ÎC£º' + C + ',×Ö¶ÎD£º' + D) + ';' from tbl WHERE (key= 'Ìõ¼þ') for xml path('')) , 1 , 1 ,'')
from tbl
WHERE (key= 'Ìõ¼þ')
group by key
ÀýÈ磺һ¸ö±íÖÐkeyΪAAµÄ¼Ç¼ÓÐ2Ìõ£¬µÚÒ»ÌõÖÐ×Ö¶ÎCµÄֵΪCC£¬×Ö¶ÎDµÄֵΪDD£¬µÚ¶þÌõÖÐ×Ö¶ÎCµÄֵΪCCC£¬×Ö¶ÎDµÄֵΪ ......
ÒÔORACLEÊý¾Ý¿âΪÀý£¬ ½«tab±íÖеÄtname×Ö¶Îת³ÉÒÔ¶ººÅ·Ö¸ôµÄ×Ö·û´®
SQLÈçÏ£º
select substr(max(sys_connect_by_path(tname, ',')), 2)
from (
select b.tname, b.t1, lead(b.t1, 1) over (order by b.t1) t2
from (
select a.tname, row_number() over (orde ......
µÚÒ»²¿·Ö »ù±¾¸ÅÄî
Ò»¡¢ ......
н¨±í£º
create table [±íÃû]
(
[×Ô¶¯±àºÅ×Ö¶Î] int IDENTITY (1,1) PRIMARY KEY ,
[×Ö¶Î1] nVarChar(50) default \'ĬÈÏÖµ\' null ,
[×Ö¶Î2] ntext null ,
[×Ö¶Î3] datetime,
[×Ö¶Î4] money null ,
[×Ö¶Î5] int default 0,
[×Ö¶Î6] Decimal (12,4) default 0,
[×Ö¶Î7] image null ,
)
ɾ³ý±í£º
Drop table [ ......