简体   繁体   English

@NotNull类型注释-Solrj

[英]@NotNull type annotation - Solrj

I have solr schema where almost every field is required=true. 我有solr模式,几乎每个字段都必须为true。

I am using following POJO to persist data in solr 我正在使用以下POJO将数据持久存储在solr中

@Field(value = "id")
private String id;

@Field(value = "entity_id")
private Long entityId;
...

Now before sending it to solr, I am currently checking explicitly each field for null. 现在,在将其发送到solr之前,我目前正在明确检查每个字段是否为null。
Is there any annotation like @NotNull or @Field attribute like required=true so that I need not to check them ? 是否有诸如@NotNull或@Field属性之类的注释,如required = true,这样我就不必检查它们了?

Unfortunately, I do not believe that SolrJ has this capability. 不幸的是,我不认为SolrJ具有此功能。 (Source - I looked at the source code. Field does not have this defined, nor are there other beans that might be useful.) (源-我查看了源代码。Field没有定义此字段,也没有其他可能有用的bean。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM