All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.optaplanner.openshift.employeerostering.server.common.AbstractRestServiceImpl Maven / Gradle / Ivy

The newest version!
package org.optaplanner.openshift.employeerostering.server.common;

import java.lang.reflect.Field;
import java.util.Collection;
import java.util.Objects;

import javax.persistence.EntityManager;

import org.optaplanner.openshift.employeerostering.shared.common.AbstractPersistable;

public class AbstractRestServiceImpl {

    protected void validateTenantIdParameter(Integer tenantId, AbstractPersistable persistable) {
        if (!Objects.equals(persistable.getTenantId(), tenantId)) {
            throw new IllegalStateException("The tenantId (" + tenantId
                    + ") does not match the persistable (" + persistable + ")'s tenantId (" + persistable.getTenantId() + ").");
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy