mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-19 15:20:20 +00:00
terminado
This commit is contained in:
@ -0,0 +1,20 @@
|
||||
package com.imprimelibros.erp.common;
|
||||
|
||||
import jakarta.persistence.AttributeConverter;
|
||||
import jakarta.persistence.Converter;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.safety.Safelist;
|
||||
|
||||
@Converter(autoApply = false)
|
||||
public class HtmlStripConverter implements AttributeConverter<String, String> {
|
||||
|
||||
@Override
|
||||
public String convertToDatabaseColumn(String attribute) {
|
||||
return attribute == null ? null : Jsoup.clean(attribute, Safelist.none());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String convertToEntityAttribute(String dbData) {
|
||||
return dbData; // tal cual
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user