• Aucun résultat trouvé

JEE Examination

N/A
N/A
Protected

Academic year: 2022

Partager "JEE Examination"

Copied!
3
0
0

Texte intégral

(1)

2011/2012 1st Semester

Name / Nom :

JEE Examination

Documents autorisés / Authorized documents : Aucun / None Durée / Duration : 1h20.

Question 1 : Pourquoi utiliser un framework ORM plutôt que du requêtage SQL explicite ? Why should we use an ORM framework rather than explicit SQL querying ?

(3 points / 5 minutes)

Question 2 : Considérons une application fonctionnant avec Hibernate pour exploiter une base de donnée Oracle, que faut-il modifier dans le fichier de configuration

hibernate.cfg.xml pour faire en sorte que l'application fonctionne sur SQL-Server ? Given an application using Hibernate to manage data from an Oracle database, what should we modify in the hibernate.cfg.xml configuration file in order to make the same application work with a SQL Server database?

(2 points / 2 minutes)

Question 3 : En quoi consiste le lazy-loading Hibernate. Quels sont les avantages et les inconvénients de cette technique ?

What is the Hibernate lazy-loading for? What are the advantages and the drawbacks of this technique?

(3 points / 5 minutes)

Question 4 : A quoi sert la méthode statique Hibernate.initialize() ? What aims the Hibernate.initialize() method?

(2 points / 5 minutes)

Question 5 : Comment se matérialise une association bidirectionnelle dans le code Java et dans le mapping Hibernate ?

How is a bidirectional association implemented in the Java code and is the Hibernate mapping?

(2 points / 5 minutes)

Question 6 : Suite à un appel à la méthode save(Object obj) d'une session

Hibernate, comment récupère t-on l'identifiant de l'objet créé si cet identifiant est généré automatiquement par la base de donnnées ?

After having called the Hibernate session's save(Object obj) method, how should we proceed to get back the saved object's identifier in case this identifier is auto-generated by the database itself?

(2 points / 2 minutes)

Question 7 : Comment procède-t-on pour mettre à jour les données liées à un objet du domaine métier pris en charge par Hibernate.

How should we proceed to update data linked to a business Object managed by Hibernate?

(2 points / 5 minutes)

(2)

Question 8 : Y-a t-il des similitudes entre le fonctionnement d'un conteneur de Servlet et le fonctionnement du conteneur léger Spring ?

Is a servlet container somehow similar to the Spring container?

(3 points / 5 minutes)

Question 9 : Quelle différences existent-il entre l'usage d'un BeanFactory et celui d'un ApplicationContext ?

What's the difference between using a BeanFactory and using an ApplicationContext?

(3 points / 5 minutes)

Question 10 : Que se passe t'il lorsqu'un bean est en portée “prototype” ? What happen when a bean is in a “prototype” scope?

(3 points / 5 minutes)

Question 11 : Quelle est la différence entre l'autowiring dit 'byName' et celui dit 'byType' ? What's the difference between autowiring 'byName' and 'byType'?

(2 points / 5 minutes)

Question 12 : En quoi consiste l'héritage de Bean avec Spring et comment fonctionne t- il ?

What are the principles of the Spring Bean inheritance and does it work?

(3 points / 6 minutes)

Question 13 : Expliquez la configuration Spring suivante : Explain the following code:

<?xml version="1.0" encoding="UTF-8"?>

<beans ... ...">

<context:component-scan base-package="com.controller"/>

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

<property name="locations" value="classpath:com/jnesis/props.properties"/>

</bean>

<bean class="com.jnesis.MyDAO"/>

<bean id="myService" class="com.jnesis.MyService" autowire="byType">

<property name="dateApplication" value="10/12/2007"/>

</bean>

<bean id="globalService" factory-bean="globalServicefactory" factory-method="getService"/>

<bean id="globalServicefactory" class="com.jnesis.MyFactory" name="defaultFactory">

<property name="params">

<set>

<value>true</value>

<bean class="com.jnesis.Option" p:name="firstRealOption">

<property name="typeName" value="${types.serviceOption}"/>

</bean>

</set>

</property>

</bean>

<bean id="conversionService"

class="org.springframework.format.support.FormattingConversionServiceFactoryBean"/>

</beans>

(6 points / 15 minutes)

Question 14 : D'après les extraits qui suivent, comment Spring va-t-il traiter les classes EmployeeService et MedicalCare ? Finalement, quels seront les beans gérés par le conteneur (précisez leur identifiant et la valeur de leurs propriétés) ?

(3)

Regarding the following code snippets, how will Spring process the EmployeeService and MedicalCare classes? Finally, which will be the beans managed by the container (indicate their identifier and properties values)?

__________________________________________________________________

...@Service

public class EmployeeService{

@Resource

private MedicalCareInterface medicare;

}

__________________________________________________________________

...

@Component("medidata")

public class MedicalCare implements MedicalCareInterface{

public MedicalCare(){

super();

}

public void register(){

System.out.println("Registration done");

} }

___________________________________________________________________

(4 points / 10 minutes)

Références

Documents relatifs

With this enhancement a programmer will be able to take a full advantage of the support for the recursive queries offered by various object-relational database management systems

En Java, ceci implique qu’il y a deux mises à jour à effectuer pour établir un lien entre deux objets (une mise à jour pour l’attribut editeur dans Livre et une mise à jour

▶ Hibernate allows arbitrary names for identifiers (function and argument names). ▶ Hibernate allows Unicode symbols

• Vous disposez uniquement du code Java, le modèle de données n'existe pas encore. You only have the Java code, the database model is to

□ Instantiating an object of class Example through a constructor taking a parameter variable having the value &#34;name&#34; and assigning the value 12 of property “id” through the

Question 18 : Avec Hibernate, comment pouvons-nous insérer un objet A en base de données, s'il a une relation “Many to Many” bidirectionnelle vers B et que B n'existe pas encore

Question 2 : Pour quelle raison pourrait-on préciser l'attrinbut “type” dans le mapping Hibernate d'une propriété d'une classe?. Que se passe t-il si on ne précise pas cet

Question 14 : Selon vous, est-il intéressant d'utiliser le jeu de balises de la JSTL permettant d'effectuer des requêtes SQL directement à partir d'une page JSP. Do you believe it