Rose :: DB :: Object.

È®Àå °¡´É, °í¼º´É °´Ã¼ °ü°èÇü ¸ÅÆÛ (ORM)
Áö±Ý ´Ù¿î·Îµå

Rose :: DB :: Object. ¼øÀ§ ¹× ¿ä¾à

±¤°í

  • Rating:
  • ƯÇã:
  • Perl Artistic License
  • °Ô½ÃÀÚ À̸§:
  • John Siracusa
  • °Ô½ÃÀÚ À¥»çÀÌÆ®:
  • http://search.cpan.org/~jsiracusa/

Rose :: DB :: Object. ű×


Rose :: DB :: Object. ¼³¸í

È®Àå °¡´É, °í¼º´É °´Ã¼ °ü°èÇü ¸ÅÆÛ (ORM) Rose :: DB :: Object´Â µ¥ÀÌÅͺ£À̽º Å×À̺íÀÇ ´ÜÀÏ ÇàÀ» ĸ½¶È­ÇÏ´Â ¿ÀºêÁ§Æ®ÀÇ Perl ¸ðµâÀÔ´Ï´Ù. Rose :: DB :: Object-Pray °´Ã¼´Â °£´ÜÇÏ°Ô "Rose :: DB :: Object °´Ã¼"°¡ °£´ÜÈ÷ "Rose :: DB :: Object °´Ã¼"¶ó°í ºÒ¸®´ÂÀÌ Å¬·¡½º¸¦ »ç¿ëÇÏ´Â À¯ÀÏÇÑ ÇÕ¸®ÀûÀÎ ¹æ¹ýÀ̶ó°í È®½ÅÇÕ´Ï´Ù. : DB :: °´Ã¼´Â »ó¼Ó ¹Þ°í ROSE :: ObjectÀÇ ±ÔÄ¢À» µû¸£°í µÚ µû¸¥´Ù. ÀÚ¼¼ÇÑ ³»¿ëÀº Rose :: Object ¼³¸í¼­¸¦ ÂüÁ¶ÇϽʽÿÀ.ÀÌ ¸ðµâ ¹èÆ÷ÆÇÀÇ ºñ°ø½Ä °³¿ä¸¦ ÂüÁ¶ÇϽʽÿÀ. Rose :: DB :: Object :: Tutorial.RestrictionsRose :: DB :: Object °³Ã¼´Â °ÅÀÇ ¸ðµç µ¥ÀÌÅͺ£À̽º Å×À̺íÀÇ ÇàÀ» ³ªÅ¸³¾ ¼ö ÀÖ½À´Ï´Ù. ´ÙÀ½°ú °°Àº Á¦¾à Á¶°Ç¿¡ µû¶ó ´Þ¶óÁú ¼ö ÀÖ½À´Ï´Ù. * µ¥ÀÌÅͺ£À̽º ¼­¹ö´Â ROSE :: DB¿¡¼­ Áö¿øÇؾßÇÕ´Ï´Ù. * µ¥ÀÌÅͺ£À̽º Å×ÀÌºí¿¡´Â ±âº» Å°°¡ ÀÖ¾î¾ßÇÕ´Ï´Ù. * ±âº» Å°´Â Ä÷³ Áß Çϳª¿¡¼­ null °ªÀ» Çã¿ëÇؼ­´Â ¾ÈµË´Ï´Ù. À§ ¸ñ·ÏÀº ´Ü´ÜÇÏ°í ºü¸¥ ±ÔÄ¢ ¸¸ Æ÷ÇԵǾî ÀÖ¾î¾ß ÇÒ ´Ù¸¥ Çö½ÇÀÌÀÖÀ» ¼ö ÀÖ½À´Ï´Ù. °¡Àå ÀϹÝÀûÀÎ ¿¹Á¦´Â ROOD :: DB :: Object APIÀÇ ¸Þ¼Òµå À̸§°ú Ãæµ¹ÇÏ´Â µ¥ÀÌÅͺ£À̽º Å×À̺íÀÇ ¿­ À̸§. ¿­ÀÌ ¸í½Ã ÀûÀ¸·Î º°¸íÀ» ¸í½Ã ÀûÀ¸·Î º°Äª ¶Ç´Â ¸ÅÇÎ ÇÔ¼ö¸¦ Á¤ÀÇÇÏ´Â µÎ °¡Áö °¡´ÉÇÑ ÇØ°á ¹æ¹ýÀÌ ÀÖ½À´Ï´Ù. ÀÚ¼¼ÇÑ ³»¿ëÀº rose :: db :: object :: metadata ¼³¸í¼­¿¡¼­ alias_column ¹× column_name_to_method_name_mapper ¸Þ¼Òµå¸¦ ÂüÁ¶ÇϽʽÿÀ. ÀÚ¼¼ÇÑ ³»¿ëÀº rose :: db¿¡¼­ Áö¿øÇÏ´Â °¢ µ¥ÀÌÅͺ£À̽º ¼­¹öÀÇ µ¥ÀÌÅÍ Çü½Ä¿¡ ´ëÇÑ µ¥ÀÌÅÍ Çü½Ä¿¡ ´ëÇÑ Áö¿ø Á¤µµ°¡ ´Ù¾çÇÕ´Ï´Ù. ±âÁ¸ ROOR :: DB :: Object :: Metadata :: Column-Pracived Ŭ·¡½º¿¡¼­ Áö¿øµÇÁö ¾Ê´Â µ¥ÀÌÅÍ Çü½ÄÀ» »ç¿ëÇÏ´Â Å×À̺íÀÌÀÖ´Â °æ¿ì, ÀÚü ¿­ Ŭ·¡½º¸¦ ÀÛ¼ºÇÑ ´ÙÀ½ À¯Çü À̸§À¸·Î ¸ÊÇÎÇؾßÇÕ´Ï´Ù. Rose :: DB :: Object :: ¸ÞŸ µ¥ÀÌÅÍÀÇ column_type_class ¸Þ¼Òµå, ¾ß´Ù ¾ß´Ù. (¶Ç´Â ¹°·Ð »õ À¯ÇüÀ» ±âÁ¸ ¿­ Ŭ·¡½º¿¡ ¸ÅÇÎ ÇÒ ¼ö ÀÖ½À´Ï´Ù.) Àüü ÇÁ·¹ÀÓ ¿öÅ©´Â È®Àå °¡´ÉÇÕ´Ï´Ù. ÀÌ ¸ðµâ ¹èÆ÷ÆÇ¿¡´Â °¡Àå ÀϹÝÀûÀÎ ¿­ À¯ÇüÀÇ Á÷¼± ±¸ÇöÀÌ Æ÷ÇԵǾî ÀÖÁö¸¸ È®½ÇÈ÷ ´õ ¸¹Àº ÀÛ¾÷À» ¼öÇà ÇÒ ¼ö ÀÖ½À´Ï´Ù. Á¦Ãâ¹°Àº Wecking.synopsis ## rose :: db :: objectÀÇ ºñ°ø½Ä °³¿ä¸¦ À§ÇØ ## Rose :: DB :: Object :: Æ©Å丮¾ó ¼³¸í¼­¸¦ ÂüÁ¶ÇϽʽÿÀ. ## ÂüÁ¶ ¹®¼­´Â ´ÙÀ½°ú °°½À´Ï´Ù. ## ¸ÕÀú Àå¹Ì :: DB µ¥ÀÌÅÍ ¼Ò½º¸¦ ¼³Á¤ÇÕ´Ï´Ù. ±×·¸Áö ¾ÊÀ¸¸é ##Àº ¸ðµÎ µ¥ÀÌÅͺ£À̽º¿¡ ¿¬°áÇÒ ¼ö ¾ø½À´Ï´Ù. ÀÚ¼¼ÇÑ ³»¿ëÀº Rose :: DB ¹®¼­¸¦ ÂüÁ¶ÇϽʽÿÀ. ## ºü¸¥ ½ÃÀÛ, Rose :: DB :: Æ©Å丮¾ó ¼³¸í¼­¸¦ ÂüÁ¶ÇϽʽÿÀ. ## ## Ŭ·¡½º »ý¼º - °¡´ÉÇÑ µÎ °¡Áö ¹æ¹ý : ## # # 1. ÀÚµ¿ ±¸¼º # ÆÐÅ°Áö Ä«Å×°í¸®; ±âº» QW (Rose :: DB :: Object)¸¦ »ç¿ëÇϽʽÿÀ. __package __-> meta-> ¼³Á¤ (table => 'categories', auto => 1,); ... ÆÐÅ°Áö °¡°Ý; ±âº» QW (Rose :: DB :: Object)¸¦ »ç¿ëÇϽʽÿÀ. __package __-> meta-> ¼³Á¤ (table => ''°¡°Ý ", auto => 1,); ... ÆÐÅ°Áö Á¦Ç°; ±âº» QW (Rose :: DB :: Object)¸¦ »ç¿ëÇϽʽÿÀ. __package __-> meta-> ¼³Á¤ (table => products ', auto => 1,); # # 2. ¼öµ¿ ±¸¼º # ÆÐÅ°Áö Ä«Å×°í¸®; ±âº» QW (Rose :: DB :: Object)¸¦ »ç¿ëÇϽʽÿÀ. __package __-> meta-> setup (table => 'categories, columns => , unique_key => , ±âº»°ª => 'ºñÈ°¼º',}, start_date => {type => 'datetime'}, end_date => {type => 'datetime'}, date_created => {type => 'timestamp', default => ' '}, last_modified => {type =>'now 'now'}, quegy_key => 'name', reignal_keys => , °ü°è => ,); ... # # ¿¹½ÃÀûÀÎ »ç¿ë¹ý # $ Product = Á¦Ç° -> »õ (id => 123, name => 'gameCube', status => 'È°¼º', start_date => '11 / 5 / 2001 ', end_date =>' 12/1/2007 ', category_id => 5); $ Product-> ÀúÀå; ... $ Product = Product-> New (ID => 123); $ Product->·Îµå; # "One-One"°ü°è¸¦ ÅëÇØ ¿ÜºÎ °³Ã¼¸¦·Îµå $ Product-> Ä«Å×°í¸® -> À̸§; $ PRODUCT-> END_DATE-> ADD (ÀÏ => 45); $ Product-> ÀúÀå; ... $ Product = Product-> New (ID => 456); $ Product->·Îµå; # "Çϳª - ¸¹Àº"°ü°è¸¦ ÅëÇØ ¿Ü±¹ ¹°Ã¼¸¦ ³ÖÀ¸½Ê½Ã¿À. "Print Print '' ', $ Product-> °¡°Ý; ...¿¡ ...


Rose :: DB :: Object. °ü·Ã ¼ÒÇÁÆ®¿þ¾î