- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
下载并尝试了新的 2.0.0.M2 版本并运行了 Pizzashop 示例,但出现了此错误
field string --fieldName shopCountry --class ~.domain.PizzaOrderPk
Option 'class' is not available for this command when the focus is set to one class.
来自示例目录的代码,但注释了第一行:
// tailor activate --name web-simple
// Create a new project
project setup --topLevelPackage com.springsource.pizzashop --projectName pizzashop
// Setup JPA persistence using EclipseLink and H2
jpa setup --provider ECLIPSELINK --database H2_IN_MEMORY
// Create domain entities
entity jpa --class ~.domain.Base --testAutomatically
field string --fieldName name --sizeMin 2 --notNull
entity jpa --class ~.domain.Topping --testAutomatically
field string --fieldName name --sizeMin 2 --notNull
entity jpa --class ~.domain.Pizza --testAutomatically
field string --fieldName name --notNull --sizeMin 2
field number --fieldName price --type java.math.BigDecimal
field set --fieldName toppings --type ~.domain.Topping
field reference --fieldName base --type ~.domain.Base
entity jpa --class ~.domain.PizzaOrder --testAutomatically --identifierType ~.domain.PizzaOrderPk
field string --fieldName name --notNull --sizeMin 2
field string --fieldName address --sizeMax 30
field number --fieldName total --type java.math.BigDecimal
field date --fieldName deliveryDate --type java.util.Date
field set --fieldName pizzas --type ~.domain.Pizza
field string --fieldName shopCountry --class ~.domain.PizzaOrderPk
field string --fieldName shopCity
field string --fieldName shopName
// Define a repository layer for persistence
repository jpa --interface ~.repository.ToppingRepository --entity ~.domain.Topping
repository jpa --interface ~.repository.BaseRepository --entity ~.domain.Base
repository jpa --interface ~.repository.PizzaRepository --entity ~.domain.Pizza
repository jpa --interface ~.repository.PizzaOrderRepository --entity ~.domain.PizzaOrder
// Define a service/facade layer
service type --interface ~.service.ToppingService --entity ~.domain.Topping
service type --interface ~.service.BaseService --entity ~.domain.Base
service type --interface ~.service.PizzaService --entity ~.domain.Pizza
service type --interface ~.service.PizzaOrderService --entity ~.domain.PizzaOrder
// Offer JSON remoting for all domain types through Spring MVC
json all --deepSerialize
web mvc json setup
web mvc json all --package ~.web
web mvc setup
web mvc all --package ~.web
// Example scripts for JSON remoting:
// curl -i -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{name: "Thin Crust"}' http://localhost:8080/pizzashop/bases
// curl -i -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '[{name: "Cheesy Crust"},{name: "Thick Crust"}]' http://localhost:8080/pizzashop/bases/jsonArray
// curl -i -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '[{name: "Fresh Tomato"},{name: "Prawns"},{name: "Mozarella"},{name: "Bogus"}]' http://localhost:8080/pizzashop/toppings/jsonArray
// curl -i -X DELETE -H "Accept: application/json" http://localhost:8080/pizzashop/toppings/7
// curl -i -X PUT -H "Content-Type: application/json" -H "Accept: application/json" -d '{id:6,name:"Mozzarella",version:1}' http://localhost:8080/pizzashop/toppings
// curl -i -H "Accept: application/json" http://localhost:8080/pizzashop/toppings
// curl -i -H "Accept: application/json" http://localhost:8080/pizzashop/toppings/6
// curl -i -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{name:"Napolitana",price:7.5,base:{id:1},toppings:[{name: "Anchovy fillets"},{name: "Mozzarella"}]}' http://localhost:8080/pizzashop/pizzas
// curl -i -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{name:"Stefan",total:7.5,address:"Sydney, AU",deliveryDate:1314595427866,id:{shopCountry:"AU",shopCity:"Sydney",shopName:"Pizza Pan 1"},pizzas:[{id:8,version:1}]}' http://localhost:8080/pizzashop/pizzaorders
这将导致:
D:\Source\Test\Pizza
λ \Tools\spring-roo-2.0.0.M2\bin\roo.bat
____ ____ ____
/ __ \/ __ \/ __ \
/ /_/ / / / / / / /
/ _, _/ /_/ / /_/ /
/_/ |_|\____/\____/ 2.0.0.M2 [rev 003b42c]
Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
Spring Roo Eastern Grey UI started at 'http://localhost:9191/'
roo> script --file pizzashop.roo
// tailor activate --name web-simple
// Create a new project
project setup --topLevelPackage com.springsource.pizzashop --projectName pizzashop
Created ROOT\pom.xml
Created SRC_MAIN_RESOURCES
Created SRC_MAIN_JAVA\com\springsource\pizzashop
Created SRC_MAIN_JAVA\com\springsource\pizzashop\PizzashopApplication.java
Created SRC_MAIN_RESOURCES\banner.txt
// Setup JPA persistence using EclipseLink and H2
jpa setup --provider ECLIPSELINK --database H2_IN_MEMORY
Created SRC_MAIN_RESOURCES\application.properties
Updated ROOT\pom.xml [added dependencies org.springframework.boot:spring-boot-starter-data-jpa:, com.h2database:h2:]
// Create domain entities
entity jpa --class ~.domain.Base --testAutomatically
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Base.java
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\BaseDataOnDemand.java
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\BaseIntegrationTest.java
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Base_Roo_Jpa_Entity.aj
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Base_Roo_ToString.aj
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\BaseIntegrationTest_Roo_Configurable.aj
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\BaseDataOnDemand_Roo_Configurable.aj
field string --fieldName name --sizeMin 2 --notNull
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Base.java
Updated ROOT\pom.xml [added dependency javax.validation:validation-api:null]
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Base_Roo_JavaBean.aj
entity jpa --class ~.domain.Topping --testAutomatically
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Topping.java
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\ToppingDataOnDemand.java
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\ToppingIntegrationTest.java
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Topping_Roo_Jpa_Entity.aj
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Topping_Roo_ToString.aj
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\ToppingIntegrationTest_Roo_Configurable.aj
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\ToppingDataOnDemand_Roo_Configurable.aj
field string --fieldName name --sizeMin 2 --notNull
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Topping.java
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Topping_Roo_JavaBean.aj
entity jpa --class ~.domain.Pizza --testAutomatically
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza.java
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\PizzaDataOnDemand.java
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\PizzaIntegrationTest.java
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza_Roo_Jpa_Entity.aj
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza_Roo_ToString.aj
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\PizzaIntegrationTest_Roo_Configurable.aj
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\PizzaDataOnDemand_Roo_Configurable.aj
field string --fieldName name --notNull --sizeMin 2
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza.java
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza_Roo_JavaBean.aj
field number --fieldName price --type java.math.BigDecimal
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza.java
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza_Roo_JavaBean.aj
field set --fieldName toppings --type ~.domain.Topping
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza.java
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza_Roo_JavaBean.aj
field reference --fieldName base --type ~.domain.Base
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza.java
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\Pizza_Roo_JavaBean.aj
entity jpa --class ~.domain.PizzaOrder --testAutomatically --identifierType ~.domain.PizzaOrderPk
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder.java
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrderPk.java
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\PizzaOrderDataOnDemand.java
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\PizzaOrderIntegrationTest.java
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder_Roo_Jpa_Entity.aj
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder_Roo_ToString.aj
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\PizzaOrderDataOnDemand_Roo_Configurable.aj
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrderPk_Roo_Configurable.aj
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrderPk_Roo_Serializable.aj
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrderPk_Roo_Identifier.aj
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrderPk_Roo_Equals.aj
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrderPk_Roo_ToString.aj
Created SRC_TEST_JAVA\com\springsource\pizzashop\domain\PizzaOrderIntegrationTest_Roo_Configurable.aj
field string --fieldName name --notNull --sizeMin 2
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder.java
Created SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder_Roo_JavaBean.aj
field string --fieldName address --sizeMax 30
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder.java
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder_Roo_JavaBean.aj
field number --fieldName total --type java.math.BigDecimal
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder.java
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder_Roo_JavaBean.aj
field date --fieldName deliveryDate --type java.util.Date
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder.java
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder_Roo_JavaBean.aj
field set --fieldName pizzas --type ~.domain.Pizza
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder.java
Updated SRC_MAIN_JAVA\com\springsource\pizzashop\domain\PizzaOrder_Roo_JavaBean.aj
field string --fieldName shopCountry --class ~.domain.PizzaOrderPk
Option 'class' is not available for this command when the focus is set to one class.
Script required 2.173 seconds to execute
Script execution aborted
~.domain.PizzaOrder roo>
最佳答案
您好,感谢您的报告。
我刚刚在 Spring Roo JIRA 上创建了一个与此问题相关的新问题问题跟踪器用于查看 Spring Roo 发行版上提供的 .roo 脚本。
https://jira.spring.io/browse/ROO-3752
回答您的问题,在 Spring Roo 2.0.0.M2 版本中,字段命令已准备好用于当前实体和 DTO 的 future 实现。根据焦点类、实体或 dto 的类型,某些命令参数将可用或不可用。因此,如果您已经将焦点集中在某个类中,则无法使用 --class
参数指示另一个不同的类,以防止您更改为其他类型并对所选类型使用无效参数。
但是,也许这不是处理该问题的最佳方法,因此我们正在分析这种行为。
作为解决方法,您可以在执行字段命令之前执行以下命令来更改焦点类:
focus --class ~.domain.PizzaOrderPk
希望这有帮助。
关于java - Spring Roo 2.0.0.M2 问题 Pizzashop 示例问题 2 - 选项 'class' 对此命令不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37480614/
在过去的几个月里,我一直在研究 Haskell,我遇到了一个我不太确定如何处理的单子(monad)的情况。 我有一个 a -> m a 类型的值第二个类型为 m (a -> a)我需要对它们进行组合,
仿函数有 (a -> b) -> m a -> m b 应用程序有 f (a -> b) -> f a -> f b Monad 有 m a -> (a -> m b) -> m b 但是,是否有扩展
我是 Haskell 的新手,我想知道是否有比 Hoogle 更好的方法来确定一个库功能是否重复? 举个例子:我有很多函数f :: Monad a => a -> m a我想链接在一起,比如 f123
将存储在一系列列表中的 m、m、n 维数组组合成一个 m、m、n 维数组的方法是什么? 示例: 这是三个包含 m,m,n 维数组的列表: list1 <- array (1, dim = c(5, 5
有没有办法写一个函数f::(a -> b -> ... -> t) -> (Monad m => m a -> m b -> ... -> m t ),基本上是 liftMn 对于任何 n? (编辑:
我有一个像这样的 pandas 数据框: df = pd.DataFrame({'A':[1,3,2,9],'B':[2,1,2,7],'C':[7,2,4,6],'D':[8,1,6,4]},ind
这个问题来自文章“Trivial Monad”,地址:http://blog.sigfpe.com/2007/04/trivial-monad.html 。提供的答案是 h x y = x >>= (
所以>>= :: m a -> (a -> m b) -> m b和>> :: m a -> m b -> m b . 而 f b -> f a . 但我想要一些能m a -> (a -> m b)
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 关闭 3 年前。 Improve
当我安装 rakudo来源: $ git clone git@github.com:rakudo/rakudo.git $ cd rakudo $ perl Configure.pl --gen-mo
我正在尝试通过查看一些练习来提高我的 Idris 技能 Software Foundations (最初是为 Coq 设计的,但我希望对 Idris 的翻译不会太糟糕)。我在使用 "Exercise:
我想知道以下是否可行。 与服务器交换密码时,应保护密码。因此,用户可以使用生成的 key kUser 来加密密码。 Encrypt(m, kUser) 生成加密消息 eU(m)。现在用户将此信息发送到
这两个表之间存在什么样的关系(1:1、1:m、m:m,等等)? CREATE TABLE IF NOT EXISTS `my_product` ( `id` int(11) NOT NULL au
有人可以解释类型的含义以及如何实现吗? class Foldable f where foldMap :: (Monoid m) => (a -> m) -> f a -> m 基于 https:
例如,在 MVC 应用程序中,我可以使用 Html 助手来创建这样的标签: @Html.LabelFor(m => m.ProductName) 我没有在任何地方声明变量“m”,但 IDE 会自动找出
更新:澄清、更明确的重点和缩短的示例: 我可以避免 M op+(M&&,M&&) 过载吗?假设,我想很好地处理 RValues?我想其他三个重载是必需的。 我首先使用 (&&,&&) 重载的原因: 通
假设我有一个函数,它接受两个向量并返回一个整数,例如一个向量中也存在另一个向量中的元素数量。喜欢: f m [,1] [,2] [,3] [1,] "c" "i" "c" [2,] "
我想将字符串(字幕)转换为: 585 00:59:59,237 --> 01:00:01,105 - It's all right. - He saw us! 586 01:00:01,139 -->
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 要求提供代码的问题必须表现出对所解决问题的最低限度理解。包括尝试过的解决方案、为什么它们不起作用,以及预
是否可以将 Linux 中的大文件将 d.m.Y h:m:s 转换为 Y-d-m h:m:s? 示例数据 "30.07.2016 00:00:00",DN123,PAPN,PAPN,TEST,9189
我是一名优秀的程序员,十分优秀!