diff --git a/querydsl-jpa/src/main/java/com/mysema/query/jpa/impl/DefaultSessionHolder.java b/querydsl-jpa/src/main/java/com/mysema/query/jpa/impl/DefaultSessionHolder.java deleted file mode 100644 index ff318b158..000000000 --- a/querydsl-jpa/src/main/java/com/mysema/query/jpa/impl/DefaultSessionHolder.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2011, Mysema Ltd - * - * 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 com.mysema.query.jpa.impl; - -import javax.persistence.EntityManager; -import javax.persistence.Query; - -/** - * Default implementation of the JPQSessionHolder interface - * - * @author tiwe - * - */ -public class DefaultSessionHolder implements JPASessionHolder{ - - private final EntityManager entityManager; - - public DefaultSessionHolder(EntityManager entityManager){ - this.entityManager = entityManager; - } - - @Override - public Query createQuery(String queryString) { - return entityManager.createQuery(queryString); - } - - @Override - public Query createSQLQuery(String sqlString) { - return entityManager.createNativeQuery(sqlString); - } - - @Override - public Query createSQLQuery(String sqlString, Class resultClass) { - return entityManager.createNativeQuery(sqlString, resultClass); - } - -} diff --git a/querydsl-jpa/src/main/java/com/mysema/query/jpa/impl/JPASessionHolder.java b/querydsl-jpa/src/main/java/com/mysema/query/jpa/impl/JPASessionHolder.java deleted file mode 100644 index dcf2b8e3b..000000000 --- a/querydsl-jpa/src/main/java/com/mysema/query/jpa/impl/JPASessionHolder.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2011, Mysema Ltd - * - * 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 com.mysema.query.jpa.impl; - -import javax.persistence.Query; - -/** - * @author tiwe - * - */ -public interface JPASessionHolder { - - /** - * Create a JPQL query for the given query string - * - * @param queryString - * @return - */ - Query createQuery(String queryString); - - /** - * Create an SQL query for the given query string - * - * @param queryString - * @return - */ - Query createSQLQuery(String queryString); - - /** - * @param queryString - * @param resultClass - * @return - */ - Query createSQLQuery(String queryString, Class resultClass); - -} diff --git a/querydsl-jpa/src/main/java/com/mysema/query/jpa/impl/NoSessionHolder.java b/querydsl-jpa/src/main/java/com/mysema/query/jpa/impl/NoSessionHolder.java deleted file mode 100644 index 628d8c65e..000000000 --- a/querydsl-jpa/src/main/java/com/mysema/query/jpa/impl/NoSessionHolder.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2011, Mysema Ltd - * - * 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 com.mysema.query.jpa.impl; - -import javax.persistence.Query; - -/** - * NoSessionHolder is a session holder for detached JPAQuery usage - * - * @author tiwe - * - */ -public class NoSessionHolder implements JPASessionHolder{ - - @Override - public Query createQuery(String queryString) { - throw new UnsupportedOperationException("No entityManager in detached Query available"); - } - - @Override - public Query createSQLQuery(String queryString) { - throw new UnsupportedOperationException("No entityManager in detached Query available"); - } - - @Override - public Query createSQLQuery(String queryString, Class resultClass) { - throw new UnsupportedOperationException("No entityManager in detached Query available"); - } - -}