Catalyst :: DBIC :: Schema.DBIX :: Ŭ·¡½º :: ½ºÅ°¸¶ ¸ðµ¨ Ŭ·¡½º | |
Áö±Ý ´Ù¿î·Îµå |
Catalyst :: DBIC :: Schema. ¼øÀ§ ¹× ¿ä¾à
±¤°í
- ƯÇã:
- Perl Artistic License
- °¡°Ý:
- FREE
- °Ô½ÃÀÚ À̸§:
- Rafael Kitover
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~rkitover/
Catalyst :: DBIC :: Schema. ű×
Catalyst :: DBIC :: Schema. ¼³¸í
DBIX :: Ŭ·¡½º :: ½ºÅ°¸¶ ¸ðµ¨ Ŭ·¡½º Catalyst :: Model :: DBIC :: Schema´Â DBIX :: Class :: ½ºÅ°¸¶ ±â¹Ý ¸ðµ¨ÀÇ Ã˸Š¸ðµ¨ÀÔ´Ï´Ù. Catalyst :: Helper :: Model :: DBIC :: Schema ÇïÆÛ ½ºÅ©¸³Æ®¸¦ ÅëÇØ ÀÌ·¯ÇÑ ¸ðµ¨À» »ý¼ºÇÏ´Â µ¥¿¡ ´ëÇÑ Á¤º¸´Â DBIC ½ºÅ°¸¶¿¡ ´ëÇÑ ÀÎÅÍÆäÀ̽º·Î ¾À ¸ðµ¨ ·¹À̾ ÀÛ¼ºµË´Ï´Ù. $ C-> ¸ðµ¨ ( 'FILLDB')°¡ ¹Ýȯ ÇÑ ¸ðµ¨ °´Ã¼´Â ÀÚüÀûÀ¸·Î DBIC ½ºÅ°¸¶ ¶Ç´Â ResultSet °´Ã¼°¡ ¾Æ´ÏÁö¸¸,ÀÌ ¸ðµ¨ Ŭ·¡½º¿¡ Ãß°¡ÇÏ´Â ±âº» ½ºÅ°¸¶¿¡ ¾×¼¼½ºÇÏ´Â ·¡ÆÛ Áõ¸í ¹æ¹ý¸¸À¸·Îµµ, ½ºÅ°¸¶ÀÇ °¢ ¼Ò½º¿¡ ´ëÇØ ¹Ù·Î °¡±â Ŭ·¡½º°¡ »ý¼ºµÇ¹Ç·Î ÇØ´ç À¯ÇüÀÇ °á°ú ÁýÇÕ¿¡ ½±°í Á÷Á¢ ¾×¼¼½º ÇÒ ¼ö ÀÖ½À´Ï´Ù. ÀÌ·¯ÇÑ »ý¼º µÈ Ŭ·¡½º´Â ¸ðµ¨ Ŭ·¡½ºº¸´Ù ¾ã¾Æ¼ °ø°³ ¸Þ¼Òµå¸¦ Á¦°øÇÏÁö¸¸ accept_context ¸ÞÄ¿´ÏÁòÀ» ÅëÇØ atalystÀÇ model () Á¢±Ù ÀÚ¿¡ °£´ÜÈ÷ ¿¬°áµË´Ï´Ù. »ý¼º µÈ °¢ Ŭ·¡½ºÀÇ ¿ÏÀüÇÑ ³»¿ëÀº ´ë·« ´ÙÀ½°ú °°½À´Ï´Ù. ÆÐÅ°Áö MyApp :: Model :: FilmDB :: Actor Sub Accept_Context {My ($ self, $ c) = @_; $ C-> ¸ðµ¨ ( 'FILLDB') -> ResultSet ( '¹è¿ì'); } ªÀº DBIC ResultSet °´Ã¼¸¦ ¾ò´Â µ¥ »ç¿ëÇÒ ¼öÀÖ´Â ¼¼ °¡Áö ±â¼úÀÌ ÀÖ½À´Ï´Ù. # ¸Çµå¸®Áî°¡ ³» $ rs = $ c-> ¸ðµ¨ ( 'filmdb') -> ½ºÅ°¸¶ -> ResultSet ( '¾×ÅÍ'); # ¸ðµ¨ °´Ã¼ÀÇ ¹Ù·Î °¡±â ¸Þ¼µå »ç¿ë My $ rs = $ c-> ¸ðµ¨ ( 'filmdb') -> ResultSet ( '¾×ÅÍ'); # »ý¼º µÈ Ŭ·¡½º¸¦ Á÷Á¢ »ç¿ëÇÏ¿© $ rs = $ c-> ¸ðµ¨ ( 'filmdb :: ¾×ÅÍ'); DBIC ResultSet¿¡ ¸Þ¼µå¸¦ Ãß°¡ÇÏ·Á¸é ´Ü¼øÈ÷ ¼Ò½º (Çà, Å×À̺í) Á¤ÀÇ Å¬·¡½º¿¡ Ãß°¡ ÇÒ ¼ö´Â ¾ø½À´Ï´Ù. º°µµÀÇ »ç¿ëÀÚ Á¤ÀÇ ResultSet Ŭ·¡½º¸¦ Á¤ÀÇÇؾßÇÕ´Ï´Ù. ÀÚ¼¼ÇÑ ³»¿ëÀº DBIX :: Class :: Manual :: CookbookÀÇ "¹Ì¸® Á¤ÀÇ µÈ °Ë»ö"À» ÂüÁ¶ÇϽʽÿÀ. DBIX :: Class :: Schema ¹× Catalyst :: Model :: DBIC :: Schema : 1. myApp / schema / filmdb.pm : package myApp :: schema :: filmdb; filmdb; ±âº» QW / DBIX :: Ŭ·¡½º :: ½ºÅ°¸¶ /; __package __-> load_classes (QW / ¾×ÅÍ ¿ªÇÒ /); 2. µ¥ÀÌÅͺ£À̽ºÀÇ Å×À̺íÀÇ ÀϺΠŬ·¡½º (¿¹ : MyApp / Schema / FILLDB / ACTOR.PM)ÀÇ ¾×ÅÍ¿Í °°ÀÌ : ÆÐÅ°Áö MYAPP :: SCHEMA :: FILMDB :: ACTOR; Base QW / DBIX :: CLASS / __PACKAGE __-> LOAD_COMPONENTS (QW / CORE /); __package __-> Å×À̺í ( '¾×ÅÍ'); ... myApp / schema / filmdb / role.pm : package myApp :: schema :: filmdb :: ¿ªÇÒ; Base QW / DBIX :: CLASS / __PACKAGE __-> LOAD_COMPONENTS (QW / CORE /); __package __-> Å×À̺í ( '¿ªÇÒ'); ... ½ºÅ°¸¶´Â MyApp :: Schema, MyApp :: Model¿¡ ¾ø½À´Ï´Ù. ÀÌ·¸°ÔÇÏ¸é µ¶¸³Çü ¸ðµâ·Î »ç¿ëÇÒ ¼ö ÀÖÀ¸¸ç Ã˸žøÀÌ Å×½ºÆ® / ½ÇÇàÇÒ ¼ö ÀÖ½À´Ï´Ù. 3. ¸ðµ¨·Î Ã˸ſ¡ ³ëÃâ ½ÃÅ°·Á¸é myApp / model / filmdb.pm : package myApp :: model :: filmdb; ±âº» QW / CATALYST :: MODEL :: DBIC :: ½ºÅ°¸¶ /; __package __-> config (schema_class => 'myApp :: schema :: filmdb', connect_info => {dsn => "dbi : ...", user => "username", password => "password",}); ¿ä±¸ »çÇ× : ¡¤ Perl.
Catalyst :: DBIC :: Schema. °ü·Ã ¼ÒÇÁÆ®¿þ¾î