sql >> データベース >  >> RDS >> Oracle

oracle11gとHibernateSpringとjsfの統合

    CustomerBoImpl.javaにorg.springframework.transaction.annotation.Transactionalをインポートします

    import java.util.List;
    import bo.ICustomerBo;
    import dao.ICustomerDao;
    import model.Customer;
    import org.springframework.transaction.annotation.Transactional;
    
    @Transactional(readOnly = true)
    public class CustomerBoImpl implements ICustomerBo{
    
        ICustomerDao customerDaoImpl;
    
    
    
        public ICustomerDao getCustomerDaoImpl() {
            return customerDaoImpl;
        }
    
        public void setCustomerDaoImpl(ICustomerDao customerDaoImpl) {
            this.customerDaoImpl = customerDaoImpl;
        }
    
    @Transactional(readOnly = false)
    @Override
        public void addCustomer(Customer customer){
    
            getCustomerDaoImpl().addCustomer(customer);
    
        }
    
    @Transactional(readOnly = false)
    @Override
        public void updateCustomer(Customer customer){
            getCustomerDaoImpl().updateCustomer(customer);
        }
    
    @Transactional(readOnly = false)
    @Override
        public void deleteCustomer(Customer customer){
            getCustomerDaoImpl().deleteCustomer(customer);
        }
    
    @Override
        public List<Customer> findAllCustomer(){
    
            return getCustomerDaoImpl().findAllCustomer();
        }
    }
    



    1. OracleのPLSQLレコードとは

    2. SQL ServerでのCOS()の例

    3. PostgreSQLは、欠落している場合、前の行の値を使用します

    4. PostgreSQL-テーブル名としての動的な値