How to enforce DB field size limit to related Java String?
- by Sri Sankaran
What is the correct way to defend against trying to store more text than can be accommodated in a VARCHAR2 database field?
Say the PARTNER_ROLE field of the REGISTRATIONS table is declared as VARCHAR2(80).
This field is mapped in the Registration class in Java as
public class Registration {
@Column(name=”PARTNER_ROLE” length=”80”)
private…