Skip to content

Tag: spring

Jpa Enum error with Smallint type in postgres

I want to put enum in my entity. But I have an error with validation which JPA wonts smallint set as enum. How I can solve this issue. “Schema-validation: wrong column type encountered in column [status] in table [order]; found [int2 (Types#SMALLINT)], but expecting [int4 (Types#INTEGER)]”[enter i…

spring try catch vs try(statement) catch – spring

I wanted to know the difference (if any) between try(statement?){} catch() and try{} catch(), that I saw applied in Spring, and if I’m also correct in .net. I have tried both but have not seen any difference. Is it for performance or just a choice? example: Answer Just wanted to mention two things befor…

Send html table with Spring Boot Mail

I want to create service that will send email messages to recipients. This message should be presented as a table which is filled from entity fields. I’m using Spring Boot Mail. Solved this task with StringBuilder. Simple MailSender configuration: Entity: Method in one of the service to send email: Serv…