
org.seasar.doma.ResultSet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of doma-core Show documentation
Show all versions of doma-core Show documentation
DAO Oriented Database Mapping Framework for Java
/*
* Copyright Doma Authors
*
* 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
*
* https://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 org.seasar.doma;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.List;
import org.seasar.doma.jdbc.ResultMappingException;
/**
* Indicates a result set that is fetch by stored functions or stored procedures.
*
* The annotated parameter type must be {@link List} and it must be one of parameters of the
* method that is annotated with {@link Function} or {@link Procedure}.
*
*
* @Dao
* public interface EmployeeDao {
*
* @Procedure
* void fetchEmployees(@In Integer departmentId, @ResultSet List<Employee> employees);
* }
*
*
*
* EmployeeDao dao = new EmployeeDaoImpl(config);
* List<Employee> employees = new ArrayList<Employee>();
* dao.fetchEmployees(10, employees);
* for (Employee e : employees) {
* ...
* }
*
*/
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface ResultSet {
/**
* Whether to ensure that all entity properties are mapped to columns of a result set.
*
* This value is used only if the result set is fetched as an entity or a entity list.
*
*
If {@code true} and there are some unmapped properties、 {@link ResultMappingException} is
* thrown from the annotated method.
*
* @return whether to ensure that all entity properties are mapped to columns of a result set
*/
boolean ensureResultMapping() default false;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy