I have the following class:
public abstract class BaseDaoImpl<T extends BaseEntity> implements BaseDao<T> {
@Override
public T createOrUpdate(T t, User user) {
return createOrUpdate(t, true, user);
}
@Override
public void addOnwerUserToEntity(String entityType, Long entityId, User user) {
BaseEntity baseEntity = findBaseEntityById(entityType, entityId);
baseEntity.addOwnerUser(user);
createOrUpdate(baseEntity, user); // compilation error
}
}
right now I have the following compilation error:
The method createOrUpdate(T, User) in the type BaseDaoImpl<T> is not applicable for the arguments (BaseEntity, User)
What am I doing wrong, why createOrUpdate
method doesn't accept BaseEntity
object and how to fix it ?