| /** |
| * |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| */ |
| package org.eclipse.osbp.utils.entitymock; |
| |
| public class MockedEntityDto { |
| |
| private final Class<?> entityDtoClass; |
| private final String persistenceUnit; |
| |
| public static final String getClassMapIndex(Class<?> forClass, String persistenceUnit) { |
| return forClass.getCanonicalName()+"@"+persistenceUnit; |
| } |
| |
| public MockedEntityDto(Class<?> entityDtoClass, String persistenceUnit) { |
| this.entityDtoClass = entityDtoClass; |
| this.persistenceUnit = persistenceUnit; |
| } |
| |
| public Class<?> getEntityDtoClass() { |
| return entityDtoClass; |
| } |
| |
| public String getPersistenceUnit() { |
| return persistenceUnit; |
| } |
| |
| public boolean equals(Class<?> forClass, String persistenceUnit) { |
| return getClassMapIndex(forClass, persistenceUnit).equals(getClassMapIndex(this.entityDtoClass, this.persistenceUnit)); |
| } |
| } |