Good afternoon,
I have the following problem I need to send an email to a specific user within my database, that user is in a specific scheme different from the pubic scheme.
How can I identify the scheme that the user belongs to?
Currently within my code is the following:
package framework.hibernate;
import org.hibernate.context.spi.CurrentTenantIdentifierResolver;
public class SchemaResolver implements CurrentTenantIdentifierResolver
{
private static String tenantIdentifier = "public";
@Override
public String resolveCurrentTenantIdentifier() {
return tenantIdentifier;
}
@Override
public boolean validateExistingCurrentSessions() {
return false;
}
public void setTenantIdentifier(String tenantIdentifier) {
SchemaResolver.tenantIdentifier = tenantIdentifier;
}
}
Inside my Java controller it looks like this:
User user = userDAO.findOneByUsername(username);
if(user != null){
código
}
In this case the user variable is filled in as null.
Thank you, sorry if the question is not understood.