Tag: programming languages

Questions Related to programming languages

  1. controls how a particular SessionFactory interacts with the Data Base.

  2. controls how a particular SessionFactory interacts with the second-level cache.

  3. controls how a particular session interacts with the second-level cache.

  4. None


Correct Option: C
  1. a) remove data from in memory

  2. b) remove from database.

  3. c) remove from sessionFactory

  4. d) None of the above.


Correct Option: B
Explanation:

To understand what sess.delete() does, we need to know that it is a method used in SQLAlchemy, which is a Python library for working with SQL databases.

The sess.delete() method is used to delete an object from the database using the SQLAlchemy session object that it is called on.

Now let's go through each option and explain why it is right or wrong:

A. a) remove data from in-memory: This option is incorrect because calling sess.delete() does not remove data from in-memory, it only marks the object for deletion from the database.

B. b) remove from the database: This option is correct. Calling sess.delete() method marks the object for deletion from the database. The object is only removed from the database when the session is committed.

C. c) remove from sessionFactory: This option is incorrect because sess.delete() method does not remove an object from the sessionFactory.

D. d) None of the above: This option is incorrect because option B is correct.

Therefore, the answer is: B. remove from the database.

  1. By using the mutable="false" attribute in the class mapping.

  2. By using the ismutable="false" attribute in the class mapping.

  3. By using the ismutable="no" attribute in the class mapping

  4. None


Correct Option: A
  1. create tables automatically

  2. create session object automatically

  3. create Session Factory object automatically

  4. None


Correct Option: A
Explanation:

The hibernate.hbm2ddl.auto property is used to automatically create database tables based on the entity classes defined in the Hibernate configuration file.

Option A is correct. When set to create, the hibernate.hbm2ddl.auto property creates the necessary tables in the database based on the entity classes defined in the Hibernate configuration file.

Option B is incorrect. The hibernate.hbm2ddl.auto property doesn't create session objects automatically.

Option C is incorrect. The hibernate.hbm2ddl.auto property doesn't create Session Factory objects automatically.

Option D is incorrect. There is a functionality associated with the hibernate.hbm2ddl.auto property.

Therefore, The Answer is A.

  1. By mapping the property with access="onlyfield" in Hibernate metadata

  2. By mapping the property with access="variable" in Hibernate metadata

  3. By mapping the property with access="field" in Hibernate metadata

  4. none of the above


Correct Option: C
  1. On session close session.load() Emp Object unavailable to access.

  2. On session close session.createCriteria() Emp unavailable to access.

  3. None

  4. a & b


Correct Option: A