This exercise will check on your knowledge of S2Dao. Check the correct statement and select the "Check" button below.
[Question 1]When the class name of the JavaBeans is Employee and table name is EMP, which of the statement below is the correct declaration to associate JavaBeans to the table?Hint: TABLE Annotation
[Question 2]When the property name is employeeNo and the column name in the EMP table is EMPNO, which of the statement below is the correct constant declaration?Hint: COLUMN Annotation
[Question 3]When the property name is ename and the column name in the EMP table is ENAME, which of the statment below is the correct constant declaration?Hint:COLUMN Annotation
[Question 4]When EMP table and SEC, DEPT tables are mapped N:1, which of the statement below is the correct RELNO constant declaration? Assume SEC table is associated with JavaBeans class Section. DEPT table is associated with JavaBeans class department. Hint:N:1 Mapping
[Question 5]Which of the statement below is the correct RELKEYS constant declaration to associate DEPTNO column in EMP table with DEPTNO is DEPT table? Assume DEPTNO is the primary key in DEPT table.Hint:N:1 Mapping
[Question 6]Which of the statement below is the correct declaration to associate both DEPTNUM column in the EMP table with DEPTNO column in the DEPT table and DEPTKEY column in the EMP table with DEPTID column in the DEPT table?Hint:N:1 Mapping
[Question 1]Which of the statement below is the correct declaration to associate EmployeeDao class with the Employee entity? Hint:BEAN Annotation
[Question 2]When public Employee getEmployee(int employeeno) method is defined, which of the statement below is the correct ARGS annotation declaration? Assume column name of the table associated with method argument is empno.Hint:ARGS Annotation
[Question 3]When public List getEmployeeByJobDeptno(String job, Integer deptno) method is defined, which of the statement below is the correct ARGS annotation declaration? Assume column name of the table is the same as the method argument name.Hint:ARGS Annotation
[Question 4]When public List getEmployeesBySal(Float minSal, Float maxSal) method that has arguments to limits the lower and upper salary (SAL) range is used to generate a SQL command, which of the QUERY annotation below will generate SQL command with a WHERE clause? Hint:QUERY Annotation
[Question 5]Which statement below is the correct way to use QUERY Annotation in a SQL comment?Hint:QUERY Annotation
[Question 6]Which of the statement below is the incorrect method definition to Insert data?Hint:Defining a Method
[Question 7]Which of the statement below is the incorrect method definition to Update data?Hint:Method Definition
[Question 8]Which of the statement below is the incorrect method definition to Delete data?Hint:Defining a Method
[Question 1]To use Dao, it is necessary to apply AOP to the registered Dao. Which of the statement below is the Interceptor to apply?Hint:dicon file
[Question 2]Which of the statement below is the correct dicon file definition? Assume S2DaoInterceptor is registered in dicon file dao.dicon.Hint:dicon file
<components> <include path="dao.dicon"/> <component class="example.dao.EmployeeDao"/> </components>
<components> <include path="dao.dicon"/> <component class="example.dao.EmployeeDao"> <arg>dao.interceptor</arg> </component> </components>
<components> <component class="example.dao.EmployeeDao"> <aspect>dao.interceptor</aspect> </component> </components>
<components> <include path="dao.dicon"/> <component class="example.dao.EmployeeDao"> <aspect>dao.interceptor</aspect> </component> </components>
[Question 1]Which of the file name below is the correct SQL file name to associate Employee method in EmployeeDao class with a SQL file?Hint:SQL file
[Question 1]public String getEmployee_ARGS = "empno";public List getEmployees(int empno);When there is a Dao with the above ARGS annotation and a method which specifies the empno (employee number), which of the statements below is the correct usage of bind variable?Hint:SQL Comment
[Question 2]public String getEmployeeCommBy_ARGS = "comm";public List getEmployeesByComm(Float comm);When there is a Dao with the above ARGS annotation and a method which specifies the Comm (commission), which of statement below will create a SQL statement with the following conditions: If Comm is not null then set the condition to that Comm. If Comm is null, then set the condition to 0.SELECT emp.*, dept.dname dname_0, dept.loc loc_0 FROM emp, dept WHERE emp.deptno = dept.deptno Hint:SQL Comment
[Question 3]SELECT * FROM EMP /*BEGIN*/WHERE/*IF job != null*/job = /*job*/'CLERK'/*END*//*IF deptno != null*/AND deptno = /*deptno*/20/*END*//*END*/When the SQL file contains the above statements, which of the SQL statement below will be generated?Hint:SQL Comment
[Question 1]Which of the class definition below will correctly use an EntityManager to execute a Query? Assume Dao is EmployeeDao interface.Hint:Executing Query with EntityManager
[Question 2]When EntityManager method is used to excute a Query and there are more than 4 variables to bind, which of the statement below is correct?Hint:Executing Query with EntityManager
[Question 3]Which of the method below will return a List when EntityManager method is used?Hint:Executing Query with EntityManager
[Question 4]Which of the method below will return an array when EntityManager method is used?Hint:Executing Query with EntityManager
[Question 5]Which of the method below will return a JavaBeans when EntityManager method is used?Hint:Executing Query with EntityManager
[Question 6]Which of the method below will return one value, such as from a result from count(*), when EntityManager method is used?Hint:Executing Query with EntityManager
[Question 1]Which of the statement below is correct when automatically generating update SQL statement?Hint:Automatic Generation of Update SQL
[Question 1]Which of the method definition will correctly automatically create update SQL statement and do a batch update?Hint:Batch Update
[Question 1]Which of the method definition below will automatically generate query SQL statement?Hint:Automati Generation of Query SQL,Defining a Method
[Question 2]SELECT * FROM EMP WHERE empno = /*empno*/7788Which of the method definition below will automatically generate SQL statement similar to the manually written SQL statement above. Assume empno is a primary key.Hint:Automatic Generation of Query SQL
[Question 3]SELECT * FROM emp/*BEGIN*/WHERE/*IF deptno != null*/deptno = /*deptno*/20/*END*//*END*/ Which of the method definition below will automatically generate SQL statement similar to the manually written SQL statement above.Hint:Automatic Generation of Query SQL