There is IntegerField(for Integer Type), NumberField(For Double Type), TextField(for String Type), BigDecimalField(For BigDecimal Type),
but there is no LongField. Why?
I am using automatic bind, by property names from Object Class:
@Entity(name = "Ven_Pedido")
public class Pedido {
@NotNull
@Column( name = "id_Pedido",nullable = false )
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer idPedido;
@Column( name = "Id_venpedidoext",nullable = false )
private Long idVenpedidoext;
//...
}
public class PedidoForm extends FormLayout {
IntegerField idPedido = new IntegerField("Id. Pedido");
//There is no :(
LongField idVenpedidoext = new LongField("Id. Ped. Ext");
//...
Binder<Pedido> binder = new BeanValidationBinder<>(Pedido.class);
public PedidoForm() {
binder.bindInstanceFields(this);
//...
}
If I use IntegerField ou NumberField I receive this error:
Property type ‘java.lang.Long’ doesn’t match the field type ‘java.lang.Integer’. Binding should be configured manually using converter.
I would like to use automatic Binder “binder.bindInstanceFields(this)”, without use converter.
Is there some approach to solve this?
Thanks for attention
}