blog.jessitron.com blog.jessitron.com

Spring and JPA: use custom value types inside entities with a custom converter

If you want secure code, or code with fewer bugs, you want to track the kind of data you’re passing around. In your code, do not pass around strings or any other built-in built-in primitive type. Those are for the edges: we have to accept strings as input, we have to write VARCHAR to the database. In between, we don’t have strings! We have Usernames, Money, SKUs, PhoneNumbers, UnencryptedPasswords, etc. Instead of language...