JavaBeat
Search JavaBeat

SCBCD TOPICS

scbcd Home

objectives

mock exams

scbcd mock - 1

scbcd mock - 2

scbcd mock - 3

scbcd mock - 4

scbcd mock - 5

scbcd mock - 6

scbcd mock - 7

scbcd mock - 8

scbcd mock - 9

scbcd mock - 10

scbcd mock - 11

scbcd mock - 12

scbcd mock - 13

scbcd mock - 14

JAVABEAT
home
articles
tips
code junction
forums
OUR NETWORK
javabeat

SCBCD Mock Questions - 4

1)Which method from the EntityContext interface, or indirectly the EJBContext interface returns the entity's bean remote home interface?

1)getEJBLocalObject
2)getEJBLocalHome
3)getEJBRemoteHome
4)getEJBHome
5)getEJBObject

2)The ______ element of the deployment descriptor specifies the primary key class that maps to multiple fields in the entity bean class. [Fill in the name of the element without brackets]

3)Which method of the javax.ejb.EntityContext interface, or indirectly the javax.ejb.EJBContext interface can be used to determine the entity bean's local home interface? (Enter the method name without the brackets) ______

4)Which method from the EntityContext interface, or indirectly the EJBContext interface returns the entity's bean local home interface?

1)getEJBLocalObject
2)getEJBLocalHome
3)getEJBLocalInterface
4)getEJBLocalHomeObject
5)getEJBObject

5)Assume the following deployment descriptor code-snippet. Which of the following statements regarding primary keys are correct? [Select all correct answers]


<entity id="OrderIdGenerator">
   <ejb-name>OrderIdGenerator</ejb-name>
   <local-home>com.baboon.ejb.OrderIdGeneratorHome</local-home>
   <local>com.baboon.ejb.OrderIdGenerator</local>
   <ejb-class>com.baboon.ejb.OrderIdGeneratorBean</ejb-class>
   <persistence-type>Container</persistence-type>

   <prim-key-class>com.baboon.ejb.OrderIdGeneratorKey</prim-key-class>
   <reentrant>False</reentrant>
   <cmp-version>2.x</cmp-version>
   <abstract-schema-name>OrderIdGenerator</abstract-schema-name>
   <cmp-field>
      <field-name>pKey</field-name>
   </cmp-field>
   <cmp-field>
      <field-name>orderId</field-name>
   </cmp-field>
</entity>
1)The primary key class, com.baboon.ejb.OrderIdGeneratorKey, must be public and contains a public constructor with the primary key field as argument.
2)The primary key class, com.baboon.ejb.OrderIdGeneratorKey, cannot be used in the deployment descriptor for CMP entity beans.
3)The element <primkey-field> is missing in the code-snippet.
4)The entity bean OrderIdGenerator will most likely make use of a compound key.
5)The Bean provider must specify the fully-qualified name of the Entity bean's primary key class in the <prim-key-class> element.

6)Consider the following OrderKey class, with primary key orderId, that represents the primary key class for the entity bean Order. Which of the following statements are correct? [Select all correct answers]


public class OrderKey implements java.io.Serializable {
private String orderId = null; 
   public OrderKey(java.lang.String orderId) {
      this.orderId = orderId;
   }
   public boolean equals(java.lang.Object otherKey) {
      return false;
   }
   public int hashCode() {
      return (orderId.hashCode());
   }
}
1)The primary key class OrderKey is a compound key class, at least 2 instance variables has to be defined to make up the primary key.
2)The primary key class OrderKey must define the orderId instance variable as public.
3)The primary key class OrderKey must define a public constructor with no parameters.
4)The primary key class OrderKey does not have getters and setters for the primary key field orderId.
5)The deployment descriptor has to define the element <primkey-field> for the instance variable orderId.

7)Which method from the EntityContext interface, or indirectly the EJBContext interface returns the entity bean's remote interface?

1)getEJBRemoteHome
2)getEJBHome
3)getEJBObject
4)getEJBLocalHome
5)getEJBLocalObject

8)Which method of the EntityContext interface can be used to return an entity bean's local interface?

1)getEJBLocalHome
2)getEJBLocalInterface
3)getEJBLocalObject
4)getEJBObject
5)getEJBLocalEntityObject

9)Which method of the javax.ejb.EntityContext interface, or indirectly the javax.ejb.EJBContext interface can be used to return the entity bean's remote home interface? (Enter the method name without the brackets) ______

10)The ______ element of the deployment descriptor specifies the container-managed field of the entity bean class that contains the primary key. [Fill in the name of the element without brackets]

SCBCD Mock Questions 4 - Answers


Sponsors
Webmaster Hosting Forum
Java Jobs
MyVideoLib
India News
Internet Advances
Latest QnA
SCJD Tips
When we start a thread by applying start() method on it ,how does it knows that to execute run()method?
About Wrapper class in Java
How to configure weblogic 7.0 in MyEclipse?
Static Block and Static Initializer in Java

JavaBeat Media (2004-2008), India
javabeat | planetoss | links directory | advertise
Copyright (2004 - 2008), JavaBeat