Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* XOR, empowering Model Driven Architecture in J2EE applications
*
* Copyright (c) 2012, Dilip Dalton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and limitations
* under the License.
*/
package tools.xor.service;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.sql.Blob;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.FlushModeType;
import javax.persistence.LockModeType;
import javax.persistence.PersistenceException;
import javax.persistence.PersistenceUnitUtil;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import tools.xor.BusinessObject;
import tools.xor.EntityType;
import tools.xor.Type;
import tools.xor.util.ClassUtil;
import tools.xor.view.JPAQuery;
import tools.xor.view.NativeQuery;
import tools.xor.view.Query;
import tools.xor.view.QueryTreeInvocation;
import tools.xor.view.StoredProcedure;
import tools.xor.view.StoredProcedureQuery;
public abstract class JPADataStore extends AbstractDataStore
{
private static final Logger logger = LogManager.getLogger(new Exception().getStackTrace()[0].getClassName());
private boolean supportsSP;
private PersistenceUtil persistenceUtil;
protected abstract EntityManager getEntityManager ();
protected abstract EntityManagerFactory getEntityManagerFactory ();
public PersistenceUtil getPersistenceUtil() {
return persistenceUtil;
}
public void setPersistenceUtil(PersistenceUtil persistenceUtil) {
this.persistenceUtil = persistenceUtil;
}
public JPADataStore ()
{
}
public JPADataStore (Object sessionContext, Object data)
{
this();
}
@Override
public void saveOrUpdate (Object entity)
{
getEntityManager().persist(entity);
}
@Override
public void clear ()
{
getEntityManager().clear();
}
@Override
public void clear (Set