HTML代码:
我想在预先输入下拉和输入中使用两个条件:
<div ng-controller="newFIncomeCtrl">
<div class="form-group col-md-4 in-inline err-group" show-errors>
<label class="control-label">Bank Name<span class="text-danger">*</span></label>
<input type="text" class="form-control input-sm" ng-model="item.bank" name="bName" tooltip="Bank Name" placeholder="Type Bank Name" typeahead="ban as ban.name for ban in banks | filter:$viewValue| limitTo:10" ng-change="change(item.bank)" ng-required=" true ">
</div>
</div>
我的头等舱FixedIncome
:
public class FixedIncome extends AbstractAuditingEntity implements Serializable {
public static final String CUSTOMERINCOME = "customerincome";
@Id
private Long id;
@DBRef
private BankName bank;
@NotNull
@DBRef
private Status status;
private int amount;
private DateTime investDate = null;
}
我的第二课BankName
:
public class BankName implements Serializable {
public static final String BANK = "bank";
public static final String BANKNAME_COLLECTION = "ag.bank";
@Id
private Long id;
@Size(min = 1, max = 100)
private String name;
@NotNull
private String statusRefId = "ACTIVE";
private Date createdDate = new Date();
private Date lastModifiedDate = new Date();
@NotNull
private String alias;
}
我收到此error
:
无法读取文档:无法从字符串值('sdrttt')实例化类型[simple type,&gt; class com.advice.domain.BankName]的值; no&gt;单字符串构造函数/工厂方法 在[来源:java.io.PushbackInputStream@35e53318; line:1,column:23](通过引用链:com.advice.domain.portfolio.FixedIncome [“bank”]);嵌套异常是com.fasterxml.jackson.databind.JsonMappingException:无法从String值('sdrttt')实例化类型[simple type,class com.advice.domain.BankName]的值;没有单字符串构造函数/工厂方法 在[来源:java.io.PushbackInputStream@35e53318; line:1,column:23](通过参考链:com.advice.domain.portfolio.FixedIncome [“bank”])