Some of my Response are kept as ResponseEntity and some as String. How should I write to the database and how should I read it? What is the best solution?
Example response
ResponseEntity<User>
String
Entity response field
@Column(name = "RESPONSE")
@Lob
@Type(type = "org.hibernate.type.TextType")
private String response;
Oracle db response column
field name: response datatype: CLOB
I will intervene with aspects and return the response in the database when necessary.
@Around("isHas()")
public Object aroundExecution(final ProceedingJoinPoint pjp) throws Throwable {
Object proceed = pjp.proceed();
UserLog userLog =userUtil.getUserLogByUsername("tommy");
if (userLog != null) {
return userLog.getResponse();
} else {
return proceed;
}
}
How can I solve?