dao

What the best way to reduce the number of queries when the Class DAO have methods that use the same result?

无人久伴 提交于 2019-12-11 14:43:31
问题 I have a helper class DAO (I do not know if is OK have this) for get Categories from MySQL DB, the struct is basically this: <?php require_once '../include/PDOConnectionFactory.php'; class CategoryDAO extends PDOConnectionFactory { /** * * @var PDO $conn */ private $conn; public function __construct() { $this->conn = PDOConnectionFactory::getConnection(); } } ?> This class have these methods (some then): getMaxLevel() getAllCategories() getAllCategoriesOfLevel($level) haveChildCategory(

Java EE: Where could I read about dao, services and why they're used? [closed]

大兔子大兔子 提交于 2019-12-11 14:29:30
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Ok I'm new at my job, and now I'm assigned to a project which uses Spring, Hibernate and Wicket. And I see a lot of DAO and Services packages and I want to understand why they're used and what is advantajes of this. I understand that DAO it's need for working with the databases, but I want more information. I

“operation is not supported for this type of object” ODBC error from running SQL pass through query

有些话、适合烂在心里 提交于 2019-12-11 12:49:52
问题 I'm putting this specific item in here because I ended up somewhere completely different on StackOverflow, and don't see this specific answer anywhere. I was getting an "ODBC error" back from running an MS Access report using an SQL passthrough query, and dao.Errors contained "Operation is not supported for this type of object" 回答1: This error is also returned from an SQL pass through query when the query throws an error because a sub query return multiple values In my case, the stored

Trigger not firing for one particular CLOB column

半腔热情 提交于 2019-12-11 12:17:53
问题 We have a C++ legacy application that connects to an Oracle 11g database. The application uses Microsoft Data Access Objects (DAO) library to allow record browsing and modification. We also have some triggers on tables to track row updates and insertions. The problem is that the triggers don't fire for the CLOB columns that we have in our tables. It gets fired for other columns but for this one CLOB column, it neither fires during update nor during delete. I've added the trigger for all three

Save DAO QueryDef to Temporary Query and Output Results to Excel

与世无争的帅哥 提交于 2019-12-11 08:32:59
问题 So I have this Access project where at first I created a TempQuery and used that query to output the results to an Excel file which works great. Here is the code for that: Dim qdf As QueryDef DoCmd.DeleteObject acQuery, "qryTemp" Set qdf = CurrentDb.CreateQueryDef("qryTemp", Me.Child13.Form.RecordSource) DoCmd.OutputTo acOutputQuery, "qryTemp", acFormatXLS, , True Exit Sub What I'm trying to do now is the same thing but using a MySQL database through DAO connection as I'm using this Access

MyBatis开发Dao的原始Dao开发和Mapper动态代理开发

痞子三分冷 提交于 2019-12-11 08:10:53
目录 咳咳...初学者看文字(Mapper接口开发四个规范)属实有点费劲,博主我就废了点劲做了如下图,方便理解: 原始Dao开发方式 1. 编写映射文件 3.编写Dao实现类 4.编写Dao测试 Mapper动态代理方式 1.定义Mapper.xml(映射文件) 2、编写UserMapper.xml配置文件内容: 3.编写UserMapper(接口文件) 4.加载UserMapper.xml文件 5.编写测试 @ 使用MyBatis开发Dao,通常有两个方法,即原始Dao开发方法和Mapper动态代理开发方法。原始Dao开发中存在以下问题: Dao方法体存在重复代码:通过SqlSessionFactory创建SqlSession,调用SqlSession的数据库操作方法 调用sqlSession的数据库操作方法需要指定statement的id,这里存在硬编码,不得于开发维护。 而动态代理开发中Mapper接口开发方法只需要程序员编写Mapper接口(相当于Dao接口),由 Mybatis框架根据接口定义创建接口的动态代理对象,代理对象的方法体同上边Dao接口实现类方法。 使用mapper代理的方法来开发dao时,程序员 只需要干两件事 即可: 1、 编写mapper.xml映射文件 2、 编写mapper接口(相当于dao接口) Mapper接口开发需要遵循以下 四个规范

How to use multiple criteria with .Find in VBA?

断了今生、忘了曾经 提交于 2019-12-11 07:56:38
问题 I am trying to .FindLast to search for a specific record, and it was working with one criteria, but when I tried to use .FindLast with multiple criteria it stopped working. However, I use almost the same statement with .FindFirst and it works which is why I am confused. The error I get is "Data type mismatch in criteria expression". And the error is for this line: rst.FindLast ("DONOR_CONTACT_ID= 'strDonor1' AND ORDER_NUMBER= 'strOrderNum1'"). I stepped through my code and the line .FindFirst

How to split a Name Field that has incorrect data?

南楼画角 提交于 2019-12-11 07:55:03
问题 I have a table with a field called PATRN_NAME which is set up with First_Name, Last_Name M.I. Examples: Smith, James M Jones, Chris J. I am trying to break up the field into FIRST_NAME, LAST_NAME and MI fields. I just asked a question about this and someone helped me use Split() to get the LAST_NAME field. However, when I try to use the Split() function for the FIRST_NAME it does not work because the field has records that do not follow the name convention of the field and instead are as

Solving JPA query finding the last entry in connected list

独自空忆成欢 提交于 2019-12-11 06:47:43
问题 Following class structure is given: class Job { String description; Collection<JobHistory> history; } class JobHistory { Date assignDate; User jobOwner; } class JobOwner { String name; String id; } This class-structure is accessible on the db via JPA. In the DAO-Layer I can write queries in JPA syntax. The Problem: I want a list with Job and JobHistory entries for a given owner with given id and who is the last one in the Jobhistory of the job (ordered by assignDate). Sounds quite complicated