OSDN Git Service

MySQLのAUTO_INCREMENTに対応した
[ea2ddl/ea2ddl.git] / ea2ddl-dao / src / main / java / jp / sourceforge / ea2ddl / dao / exbhv / TAttributetagBhv.java
index 296ff97..a38a221 100644 (file)
@@ -1,13 +1,34 @@
 package jp.sourceforge.ea2ddl.dao.exbhv;\r
 \r
+import java.util.HashMap;\r
+import java.util.Map;\r
+\r
+import jp.sourceforge.ea2ddl.dao.cbean.TAttributetagCB;\r
+import jp.sourceforge.ea2ddl.dao.exentity.TAttribute;\r
+import jp.sourceforge.ea2ddl.dao.exentity.TAttributetag;\r
+\r
+import org.seasar.dbflute.cbean.ListResultBean;\r
+\r
 /**\r
  * The behavior of t_attributetag.\r
  * <p>\r
- * You can implement your original methods here.\r
- * This class is NOT overrided when re-generating.\r
+ * You can implement your original methods here. This class is NOT overrided\r
+ * when re-generating.\r
  * </p>\r
+ * \r
  * @author DBFlute(AutoGenerator)\r
- */
-@SuppressWarnings("unchecked")\r
-public class TAttributetagBhv extends jp.sourceforge.ea2ddl.dao.bsbhv.BsTAttributetagBhv {\r
+ */\r
+public class TAttributetagBhv extends\r
+               jp.sourceforge.ea2ddl.dao.bsbhv.BsTAttributetagBhv {\r
+\r
+       public void loadTags(TAttribute attribute) {\r
+               TAttributetagCB cb = new TAttributetagCB();\r
+               cb.query().setElementid_Equal(attribute.getId());\r
+               ListResultBean<TAttributetag> list = selectList(cb);\r
+               Map<String, TAttributetag> map = new HashMap<String, TAttributetag>();\r
+               for (TAttributetag tAttributetag : list) {\r
+                       map.put(tAttributetag.getProperty(), tAttributetag);\r
+               }\r
+               attribute.setTags(map);\r
+       }\r
 }\r