ITeye博客

jpa merge 一个属性为null的model

whoosh · 2012-08-07 15:11 · ORM · 编程语言 · Markdown

使用OpenJPA 的时候merge一个model, 他的某一个属性为空,但是本来那个属性不为空,发现不能使其变为空。

 

if (gradebookitem.getStandards() == null){
	    			List<Standards> standards = new ArrayList<Standards>();
	    			gradebookitem.setStandards(standards);
	    		}

 

可以进行如上操作,使其变为空。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。