小编Ina*_*lla的帖子

整数获取默认值0,其中Java中需要为NULL

我的要求看起来很简单,但我觉得我在代码中做错了.

我只需要在没有从UI的InputText字段传递任何内容时在Oracle数据库中插入"null".

PaymantSpecFormPage.xhtml

<h:inputText id="startWeek" value="#{flowScope.paymentSpecVO.paymStartWk}" styleClass="inputTypeForm" maxlength="4"/>
Run Code Online (Sandbox Code Playgroud)

PaymentSpecVO.java

public class PaymentSpecVO extends BaseVO<PaymentSpec> {
   private Integer paymStartWk;

   public Integer getPaymStartWk() {
      return paymStartWk;
   }
   public void setPaymStartWk(Integer paymStartWk) {
      this.paymStartWk = paymStartWk;
   }
}
Run Code Online (Sandbox Code Playgroud)

在我的数据库表中

COLUMN_NAME      DATA_TYPE    NULLABLE    DEFAULT_VALUE
------------     ---------    --------    -------------
PAYM_START_WK    NUMBER(4,0)    Yes             null
Run Code Online (Sandbox Code Playgroud)

当我在inputText中没有输入任何内容时,那么在表格中输入0而不是null,这在我的业务逻辑中有不同的含义,请帮我做必要的代码更改.

jsf integer

11
推荐指数
1
解决办法
1万
查看次数

Git推送失败HTTP 500卷曲22请求的URL返回错误:500内部服务器错误

我刚为我的windows机器设置了带位桶的git.

Git pull正常工作,git push失败时出现以下错误.

$ git push
Counting objects: 10, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 174.03 KiB | 0 bytes/s, done.
Total 10 (delta 6), reused 0 (delta 0)
error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500 Internal Server Error
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date
Run Code Online (Sandbox Code Playgroud)

任何帮助都很有用.

谢谢

windows git bitbucket git-push

11
推荐指数
3
解决办法
9330
查看次数

标签 统计

bitbucket ×1

git ×1

git-push ×1

integer ×1

jsf ×1

windows ×1