diff --git a/querydsl-sql-spring/pom.xml b/querydsl-sql-spring/pom.xml index a74e977e0..ed6d71d1a 100644 --- a/querydsl-sql-spring/pom.xml +++ b/querydsl-sql-spring/pom.xml @@ -5,7 +5,7 @@ com.mysema.querydsl querydsl-root - 3.4.2.BUILD-SNAPSHOT + 3.5.0.BUILD-SNAPSHOT ../querydsl-root/pom.xml diff --git a/querydsl-sql-spring/src/main/java/com/mysema/query/sql/spring/SpringConnectionProvider.java b/querydsl-sql-spring/src/main/java/com/mysema/query/sql/spring/SpringConnectionProvider.java index 123beea77..96975a315 100644 --- a/querydsl-sql-spring/src/main/java/com/mysema/query/sql/spring/SpringConnectionProvider.java +++ b/querydsl-sql-spring/src/main/java/com/mysema/query/sql/spring/SpringConnectionProvider.java @@ -1,3 +1,16 @@ +/* + * Copyright 2014, Timo Westkämper + * + * 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.sql.spring; import javax.inject.Provider; @@ -6,6 +19,17 @@ import java.sql.Connection; import org.springframework.jdbc.datasource.DataSourceUtils; +/** + * SpringConnectionProvider is a Provider implementation which provides a transactionally bound connection + * + *

Usage example

+ *
+ * {@code
+ * Provider provider = new SpringConnectionProvider(dataSource());
+ * SQLQueryFactory queryFactory = SQLQueryFactory(configuration, provider);
+ * }
+ * 
+ */ public class SpringConnectionProvider implements Provider { private final DataSource dataSource; diff --git a/querydsl-sql-spring/src/main/java/com/mysema/query/sql/spring/SpringExceptionTranslator.java b/querydsl-sql-spring/src/main/java/com/mysema/query/sql/spring/SpringExceptionTranslator.java index d6a532e73..b4923ff08 100644 --- a/querydsl-sql-spring/src/main/java/com/mysema/query/sql/spring/SpringExceptionTranslator.java +++ b/querydsl-sql-spring/src/main/java/com/mysema/query/sql/spring/SpringExceptionTranslator.java @@ -1,3 +1,16 @@ +/* + * Copyright 2014, Timo Westkämper + * + * 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.sql.spring; import java.sql.SQLException; @@ -6,6 +19,19 @@ import java.util.List; import org.springframework.jdbc.support.SQLExceptionTranslator; import org.springframework.jdbc.support.SQLStateSQLExceptionTranslator; +/** + * SpringExceptionTranslator is an SQLExceptionTranslator implementation which uses Spring's + * exception translation functionality internally + * + *

>Usage example

+ *
+ * {@code
+ * Configuration configuration = new Configuration(templates);
+ * configuration.setExceptionTranslator(new SpringExceptionTranslator());
+ * }
+ * 
+ * + */ public class SpringExceptionTranslator implements com.mysema.query.sql.SQLExceptionTranslator { private final SQLExceptionTranslator translator;