【发布时间】:2011-05-05 05:59:46
【问题描述】:
我正在尝试将我发布到我的 groovy 控制器的 JSONObject。我可以传递对象,查看 JSON 数据,然后从中创建一个域对象。当我将其保存以写入数据库时,它会改为执行 Select 。
def save = {
def input = request.JSON
def instance = new Customers(input)
instance.save()
}
这是我的调试 sql 输出
Hibernate:
select
this_.customers_id as customers1_237_0_,
this_.customers_default_address_id as customers2_237_0_,
this_.customers_dob as customers3_237_0_,
this_.customers_email_address as customers4_237_0_,
this_.customers_email_address2 as customers5_237_0_,
this_.customers_fax as customers6_237_0_,
this_.customers_firstname as customers7_237_0_,
this_.customers_gender as customers8_237_0_,
this_.customers_lastname as customers9_237_0_,
this_.customers_membertype as customers10_237_0_,
this_.customers_memo1 as customers11_237_0_,
this_.customers_mname as customers12_237_0_,
this_.customers_newsletter as customers13_237_0_,
this_.customers_password as customers14_237_0_,
this_.customers_point_date as customers15_237_0_,
this_.customers_telephone as customers16_237_0_,
this_.customers_total_points as customers17_237_0_,
this_.customers_username as customers18_237_0_
from
customers this_
where
this_.customers_username=?
不知道是什么原因造成的。
【问题讨论】:
-
你能举个“输入”的例子吗?
标签: android grails groovy save