{"id":699,"date":"2012-10-06T11:39:21","date_gmt":"2012-10-06T02:39:21","guid":{"rendered":"http:\/\/www.whoocus.com\/blog\/?p=699"},"modified":"2012-10-08T00:17:22","modified_gmt":"2012-10-07T15:17:22","slug":"spring-roo%e3%82%92%e8%a7%a6%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b-%e3%81%9d%e3%81%ae%ef%bc%91","status":"publish","type":"post","link":"https:\/\/www.blowfish.co.jp\/?p=699","title":{"rendered":"Spring Roo\u3092\u89e6\u3063\u3066\u307f\u308b"},"content":{"rendered":"<p>Blog\u306e\u30a8\u30f3\u30c8\u30ea\u306b\u306f\u8a18\u8f09\u3057\u3066\u3044\u306a\u3044\u304c\u3001Java\u306eFramework\u3068\u3057\u3066\u306f\u3001Seasar2\u3092\u4f7f\u7528\u3057\u3066\u304d\u305f\u3002<br \/>\n\u4eca\u56de\u3069\u3046\u3044\u3046\u308f\u3051\u304b\u3001SpringFramework\u306b\u63a5\u3059\u308b\u6a5f\u4f1a\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u73fe\u5728\u52c9\u5f37\u4e2d\u306a\u306e\u3067\u3042\u308b\u304c\u3001\u52e2\u3044\u4f59\u3063\u3066 Spring Roo \u306b\u6311\u6226\u3057\u3066\u307f\u3088\u3046\u3068\u601d\u3063\u305f\u3002<br \/>\n\u305d\u3082\u305d\u3082\u3001SpringFramework \u306b\u95a2\u3057\u3066\u306f\u7d0410\u5e74\u524d\u7a0b\u306b\u77e5\u8b58\u4e0d\u8db3\u3067\u8131\u843d\u3057\u3066\u3044\u305f\u3002<br \/>\n\u305d\u308c\u4ee5\u6765\u3001\u8208\u5473\u3082\u4f55\u3082\u306a\u304b\u3063\u305f\u304c\u3001Seasar2 \u306b\u6163\u308c\u3066\u3001\u6982\u5ff5\u7684\u306a\u90e8\u5206\u306e\u7406\u89e3\u306f\u30af\u30ea\u30a2\u3057\u3066\u3044\u308b\u3064\u3082\u308a\u306a\u306e\u3067\u3001\u4eca\u56de\u306f\u3001SpringFramework \u81ea\u4f53\u3082\u300110\u5e74\u524d\u3088\u308a\u3082\u30b9\u30f3\u30ca\u30ea\u3068\u982d\u3067\u60f3\u50cf\u3067\u304d\u305f\u3002\u3064\u3082\u308a\u3002<\/p>\n<p>\u5927\u65b9\u306f\u3001SpringRoo \u306e\u30b5\u30a4\u30c8(\u82f1\u8a9e)\u306b\u8a18\u8f09\u3057\u3066\u3042\u308b\u901a\u308a\u3060\u304c\u3002<br \/>\n\u6e96\u5099\u3068\u3057\u3066\u306f\u3001Maven \u3068 Roo \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\uff06\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u30d1\u30b9\u306b\u542b\u3081\u3066\u3055\u3041\u958b\u59cb\u3002<\/p>\n<p>[bash]<br \/>\nC:\\works\\hello&gt;roo<br \/>\n    ____  ____  ____<br \/>\n   \/ __ \\\/ __ \\\/ __ \\<br \/>\n  \/ \/_\/ \/ \/ \/ \/ \/ \/ \/<br \/>\n \/ _, _\/ \/_\/ \/ \/_\/ \/<br \/>\n\/_\/ |_|\\____\/\\____\/    1.2.2.RELEASE [rev 7d75659]<\/p>\n<p>Welcome to Spring Roo. For assistance press TAB or type &quot;hint&quot; then hit ENTER.<br \/>\n@krimple: Just submitted my talk proposal for SpringOne\/2GX on Roo add-on development. Keeping finge<br \/>\nrs crossed? @SpringRoo<\/p>\n<p>At this time you have not authorized Spring Roo to download an index of<br \/>\navailable add-ons. This will reduce Spring Roo features available to you.<br \/>\nPlease type &#8216;download status&#8217; and press ENTER for further information.<\/p>\n<p>roo&gt;<br \/>\n[\/bash]<\/p>\n<p>\u304a\u624b\u672c\u901a\u308a\u306b\u3001hint \u30b3\u30de\u30f3\u30c9\u3002<br \/>\n[bash]<br \/>\nroo&gt; hint<br \/>\nWelcome to Roo! We hope you enjoy your stay!<\/p>\n<p>Before you can use many features of Roo, you need to start a new project.<\/p>\n<p>To do this, type &#8216;project&#8217; (without the quotes) and then hit TAB.<\/p>\n<p>Enter a &#8211;topLevelPackage like &#8216;com.mycompany.projectname&#8217; (no quotes).<br \/>\nWhen you&#8217;ve finished completing your &#8211;topLevelPackage, press ENTER.<br \/>\nYour new project will then be created in the current working directory.<\/p>\n<p>Note that Roo frequently allows the use of TAB, so press TAB regularly.<br \/>\nOnce your project is created, type &#8216;hint&#8217; and ENTER for the next suggestion.<br \/>\nYou&#8217;re also welcome to visit http:\/\/forum.springframework.org for Roo help.<br \/>\n[\/bash]<\/p>\n<p>\u30c8\u30c3\u30d7\u30ec\u30d9\u30eb\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u6253\u3063\u3066\u304f\u308c\u3068\u306e\u3053\u3068\u306a\u306e\u3067\u3002\u3068\u308a\u3042\u3048\u305a\u3001sample\u30d1\u30c3\u30b1\u30fc\u30b8\u3002<br \/>\n[bash]<br \/>\nroo&gt; project &#8211;topLevelPackage com.whoocus.sample<br \/>\nCreated ROOT\\pom.xml<br \/>\nCreated SRC_MAIN_RESOURCES<br \/>\nCreated SRC_MAIN_RESOURCES\\log4j.properties<br \/>\nCreated SPRING_CONFIG_ROOT<br \/>\nCreated SPRING_CONFIG_ROOT\\applicationContext.xml<br \/>\n[\/bash]<\/p>\n<p>\u308f\u304a\uff01\uff01\u96db\u5f62\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<p>\u6b21\u306f\u3001DB\u306e\u8a2d\u5b9a\u3002\u6b63\u76f4\u3001jpa \u3068\u304b hibernate \u306b\u95a2\u3057\u3066\u306f\u7121\u77e5\u306a\u306e\u3067\u3001\u5f8c\u306b\u8abf\u3079\u308b\u3068\u3057\u3066\u3001\u304a\u624b\u672c\u901a\u308a\u306b\u30b3\u30de\u30f3\u30c9\u6253\u3063\u3066\u307f\u308b\u3002<br \/>\n\u3061\u306a\u307f\u306b\u3001DB\u306f\u3001MySql\u3002&#8221;MYSQL&#8221; \u3068\u5927\u6587\u5b57\u3067\u6253\u3061\u8fbc\u307e\u306a\u3044\u3068\u3001\u30a8\u30e9\u30fc\u306b\u306a\u3063\u305f\u3002<br \/>\n[bash]<br \/>\nroo&gt; jpa setup &#8211;provider HIBERNATE &#8211;database MYSQL &#8211;hostname localhost &#8211;databaseName roo_db &#8211;<br \/>\n-userName hoge &#8211;password hoge<br \/>\nCreated SPRING_CONFIG_ROOT\\database.properties<br \/>\nPlease update your database details in src\/main\/resources\/META-INF\/spring\/database.properties.<br \/>\nUpdated SPRING_CONFIG_ROOT\\applicationContext.xml<br \/>\nCreated SRC_MAIN_RESOURCES\\META-INF\\persistence.xml<br \/>\nUpdated ROOT\\pom.xml [added dependencies mysql:mysql-connector-java:5.1.18, org.hibernate:hibernate-<br \/>\ncore:3.6.9.Final, org.hibernate:hibernate-entitymanager:3.6.9.Final, org.hibernate.javax.persistence<br \/>\n:hibernate-jpa-2.0-api:1.0.1.Final, commons-collections:commons-collections:3.2.1, org.hibernate:hib<br \/>\nernate-validator:4.2.0.Final, javax.validation:validation-api:1.0.0.GA, cglib:cglib-nodep:2.2.2, jav<br \/>\nax.transaction:jta:1.1, org.springframework:spring-jdbc:${spring.version}, org.springframework:sprin<br \/>\ng-orm:${spring.version}, commons-pool:commons-pool:1.5.6, commons-dbcp:commons-dbcp:1.3]<br \/>\n[\/bash]<\/p>\n<p>\u308f\u304a\u3063\uff01\uff01\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u304c\u751f\u6210\u3055\u308c\u305f\u3002pom.xml \u3082\u66f4\u65b0\u3055\u308c\u308b\u3088\u3046\u3060\u3002\u6b63\u76f4\u3001pom.xml \u306f\u904e\u53bb\u306b\u3082\u826f\u304f\u898b\u304b\u3051\u305f\u3053\u3068\u304c\u3042\u3063\u305f\u306e\u3060\u304c\u3001\u4f55\u8005\u3067\u3042\u308b\u304b\u77e5\u3089\u306a\u304b\u3063\u305f\u3002Maven\u95a2\u9023\u306e\u30d5\u30a1\u30a4\u30eb\u3089\u3057\u3044\u3068\u6c17\u4ed8\u304f\u3002Maven\u3082\u3001\u540d\u524d\u3060\u3051\u3067\u4f55\u3060\u304b\u77e5\u3089\u306a\u304b\u3063\u305f\u306e\u3060\u3051\u3069\u306d\u3002<br \/>\n\u3053\u308c\u3082\u3001\u3053\u308c\u304b\u3089\u52c9\u5f37\u4e88\u5b9a\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u4eca\u5ea6\u306f\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u30af\u30e9\u30b9\u751f\u6210\u304b\u306a\uff1f<br \/>\nMember\u30af\u30e9\u30b9\u3092\u6253\u3061\u8fbc\u3080\u3002<br \/>\n\u304c\u3001\u3057\u304b\u3057\u751f\u6210\u3055\u308c\u305a\u3001User\u30af\u30e9\u30b9\u306f\u3069\u3046\u304b\uff1f<br \/>\n\u3084\u306f\u308a\u99c4\u76ee\u3002<br \/>\n[bash]<br \/>\nroo&gt; entity jpa &#8211;class model.Member &#8211;testAutomatically<br \/>\nReserved SQL keyword &#8216;Member&#8217; is not permitted as simple type name<br \/>\nmodel.Member roo&gt; field string &#8211;fieldName lastName &#8211;notNull<br \/>\nThe type specified, &#8216;model.Member&#8217;doesn&#8217;t exist<\/p>\n<p>model.Member roo&gt; entity jpa &#8211;class ~.User &#8211;testAutomatically<br \/>\nReserved SQL keyword &#8216;User&#8217; is not permitted as simple type name<br \/>\n[\/bash]<\/p>\n<p>\u304a\u624b\u672c\u901a\u308a\u3001Timer\u30af\u30e9\u30b9\u3067\u6253\u3061\u8fbc\u3080\u3068\u6210\u529f\u3002\u3067\u3082\u3001\u305d\u3093\u306a\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u306f\u3044\u3089\u306a\u3044\u3002<br \/>\n\u8abf\u3079\u3066\u307f\u308b\u3068\u3001\u30aa\u30d7\u30b7\u30e7\u30f3(&#8211;permitReservedWords)\u3092\u4ed8\u52a0\u3059\u308b\u3068\u3001\u4f5c\u6210\u3055\u308c\u308b\u3089\u3057\u3044\u3002<\/p>\n<p>\u3069\u3046\u3082\u7c21\u5358\u306a\u5358\u8a9e\u306f\u3001\u306f\u3058\u304b\u308c\u3066\u3057\u307e\u3046\u3088\u3046\u3060\u3002Order \u3068\u304b\u3002\u3061\u3087\u3063\u3068\u8151\u306b\u843d\u3061\u306a\u3044\u3002<\/p>\n<p>[bash]<br \/>\n~.Member roo&gt; entity jpa &#8211;class ~.Member &#8211;testAutomatically &#8211;permitReservedWords<br \/>\nCreated SRC_MAIN_JAVA\\com\\whoocus\\sample\\Member.java<br \/>\nCreated SRC_TEST_JAVA\\com\\whoocus\\sample\\MemberDataOnDemand.java<br \/>\nCreated SRC_TEST_JAVA\\com\\whoocus\\sample\\MemberIntegrationTest.java<br \/>\nCreated SRC_MAIN_JAVA\\com\\whoocus\\sample\\Member_Roo_Configurable.aj<br \/>\nCreated SRC_MAIN_JAVA\\com\\whoocus\\sample\\Member_Roo_Jpa_Entity.aj<br \/>\nCreated SRC_MAIN_JAVA\\com\\whoocus\\sample\\Member_Roo_Jpa_ActiveRecord.aj<br \/>\nCreated SRC_MAIN_JAVA\\com\\whoocus\\sample\\Member_Roo_ToString.aj<br \/>\nCreated SRC_TEST_JAVA\\com\\whoocus\\sample\\MemberDataOnDemand_Roo_Configurable.aj<br \/>\nCreated SRC_TEST_JAVA\\com\\whoocus\\sample\\MemberDataOnDemand_Roo_DataOnDemand.aj<br \/>\nCreated SRC_TEST_JAVA\\com\\whoocus\\sample\\MemberIntegrationTest_Roo_Configurable.aj<br \/>\nCreated SRC_TEST_JAVA\\com\\whoocus\\sample\\MemberIntegrationTest_Roo_IntegrationTest.aj<br \/>\n[\/bash]<br \/>\n\u6210\u529f\uff01\uff01<br \/>\n\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u30d5\u30a9\u30eb\u30c0\u3092\u898b\u3066\u307f\u308b\u3068\u3001\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u51fa\u6765\u3066\u307e\u3059\u3002\u611f\u52d5\u3067\u3059\u3002<br \/>\n\u307e\u308b\u3067\u3001Ruby on Rails \u306e\u3088\u3046\u3067\u3059\u3002\u307e\u3042\u3001Rails \u3063\u307d\u304b\u3063\u305f\u304b\u3089\u3001SpringRoo \u306b\u6311\u6226\u3057\u3066\u3044\u308b\u8a33\u3067\u3059\u304c\u2026\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001Member\u30af\u30e9\u30b9\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u5b9a\u7fa9\u3002<br \/>\n[bash]<br \/>\n~.Member roo&gt; field string &#8211;fieldName lastName &#8211;notNull<br \/>\nUpdated SRC_MAIN_JAVA\\com\\whoocus\\sample\\Member.java<br \/>\nUpdated SRC_TEST_JAVA\\com\\whoocus\\sample\\MemberDataOnDemand_Roo_DataOnDemand.aj<br \/>\nCreated SRC_MAIN_JAVA\\com\\whoocus\\sample\\Member_Roo_JavaBean.aj<br \/>\n~.Member roo&gt; field string &#8211;fieldName firstName &#8211;notNull<br \/>\nUpdated SRC_MAIN_JAVA\\com\\whoocus\\sample\\Member.java<br \/>\nUpdated SRC_TEST_JAVA\\com\\whoocus\\sample\\MemberDataOnDemand_Roo_DataOnDemand.aj<br \/>\nUpdated SRC_MAIN_JAVA\\com\\whoocus\\sample\\Member_Roo_JavaBean.aj<br \/>\n~.Member roo&gt; field int &#8211;fieldName age &#8211;notNull<br \/>\n[\/bash]<\/p>\n<p>\u308f\u304a\u3063\u308f\u304a\u3063\u3002Java\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3082\u66f4\u65b0\u3055\u308c\u3066\u3044\u308b\u3002\u30ca\u30a4\u30b9\u3002<\/p>\n<p>[java]<br \/>\npackage com.whoocus.sample;<\/p>\n<p>import javax.validation.constraints.NotNull;<br \/>\nimport org.springframework.roo.addon.javabean.RooJavaBean;<br \/>\nimport org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;<br \/>\nimport org.springframework.roo.addon.tostring.RooToString;<\/p>\n<p>@RooJavaBean<br \/>\n@RooToString<br \/>\n@RooJpaActiveRecord<br \/>\npublic class Member {<\/p>\n<p>    @NotNull<br \/>\n    private String lastName;<\/p>\n<p>    @NotNull<br \/>\n    private String firstName;<br \/>\n}<br \/>\n[\/java]<\/p>\n<p>\u8abf\u5b50\u306b\u4e57\u3063\u3066\u3001int\u578b\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u5b9a\u7fa9\u3057\u3088\u3046\u3068\u3057\u305f\u304c\u3001\u30a8\u30e9\u30fc\u3002<br \/>\nInteger\u578b\u306a\u3089\u3069\u3046\u3060\u3063\uff1f\u3000\u30a8\u30e9\u30fc\u3002<br \/>\n[bash]<br \/>\n~.Member roo&gt; field int &#8211;fieldName age &#8211;notNull<br \/>\nCommand &#8216;field int &#8211;fieldName age &#8211;notNull&#8217; not found (for assistance press TAB or type &quot;hint&quot; then hit ENTER)<\/p>\n<p>At this time you have not authorized Spring Roo to download resources from<br \/>\nVMware domains. Some Spring Roo features are therefore unavailable. Please<br \/>\ntype &#8216;download status&#8217; and press ENTER for further information.<\/p>\n<p>Spring Roo automatic add-on discovery service currently unavailable<br \/>\n~.Member roo&gt; field integer &#8211;fieldName age &#8211;notNull<br \/>\nCommand &#8216;field integer &#8211;fieldName age &#8211;notNull&#8217; not found (for assistance press TAB or type &quot;hint&quot; then hit ENTER)<br \/>\n[\/bash]<\/p>\n<p>\u3069\u3046\u3084\u3089\u3001int\u578b\u306e\u6307\u5b9a\u65b9\u6cd5\u306f\u4e0b\u8a18\u306e\u3088\u3046\u3060\u3002<br \/>\n[bash]<br \/>\n~.Member roo&gt; field number &#8211;fieldName age &#8211;type int<br \/>\n[\/bash]<\/p>\n<p>\u304a\u3084\u3064\u306e\u6642\u9593\u306a\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a\u3053\u3053\u307e\u3067\u3002<br \/>\n\u307e\u305f\u6b21\u56de\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Blog\u306e\u30a8\u30f3\u30c8\u30ea\u306b\u306f\u8a18\u8f09\u3057\u3066\u3044\u306a\u3044\u304c\u3001Java\u306eFramework\u3068\u3057\u3066\u306f\u3001Seasar2\u3092\u4f7f\u7528\u3057\u3066\u304d\u305f\u3002 \u4eca\u56de\u3069\u3046\u3044\u3046\u308f\u3051\u304b\u3001SpringFramework\u306b\u63a5\u3059\u308b\u6a5f\u4f1a\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u73fe\u5728\u52c9\u5f37\u4e2d\u306a\u306e\u3067\u3042\u308b\u304c\u3001\u52e2\u3044\u4f59\u3063\u3066 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"saved_in_kubio":false,"footnotes":""},"categories":[9,27,26,4],"tags":[],"class_list":["post-699","post","type-post","status-publish","format-standard","hentry","category-java","category-roo","category-spring","category-tech"],"_links":{"self":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=699"}],"version-history":[{"count":8,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/699\/revisions"}],"predecessor-version":[{"id":710,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/699\/revisions\/710"}],"wp:attachment":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}