This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Modern JavaScript for the Impatient and have Cay Horstmann on-line!
See this thread for details.
Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Need answers for this hibernate quiz as i dont have enough time to study and answer

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of these are true of state changes of an object?
A. State changes from Persistent to Detached on session.close() during a Read operation
B. State changes from Persistent to Detached on session.delete() during a Delete operation
C. State changes from Transient to Persistent on session.delete() during a Delete operation
D. State changes from Transient to Detached on session.close() during a Read operation
2
Which of these is NOT true of Annotations?
A. Annotations tell Hibernate how to persist a class
B. Entity is an annotation that can be imported from javax.persistence
C. Annotation is prefixed by @ symbol
D. Property is an annotation that can be imported from javax.persistence
3
What are NOT valid annotations for embedded objects?
A. @embeddedObjects
B. @embedded
C. @AttributeOverride
D. @AttributeOverrides
4
session.createCriteria() takes in ________________ as an argument for fetching records
A. Class
B. Query
C. String
D. Integer
5
Which of this is true of keys?
A. Surrogate key can contain duplicates while primary key does not
B. Surrogate Key is not business data, but identifies a record uniquely
C. Primary Key and Surrogate Key can be used interchangably
D. Surrogate key is like a column containing serial number of the records
6
Which of these is true of caching in Hibernate?
A. First Level Cache is a level of cache that is provided by default by Hibernate.
B. First Level Cache can be used only witin the session
C. First Level Cache can be implemented across sessions in a single application, while a Second Level Cache can be implemented across applications
D. Second Level of Cache can be implemented across applications and also clusters
7
In order to apply cache to queries, you must set which of these properties in the Hibernate Configuration file?
A. Set both cache.use_second_level_cache to true and cache.use_query_cache to true. These work together
B. Set only cache.use_second_level_cache to true. This will work for Query as well
C. cache.use_second_level_cache to false and cache.use_query_cache to true. Only one of these can be active at a time
D. cache.use_second_level_cache to true if you use session.get() and cache.use_query_cache to true for any queries
8
With @ManyToMany annotation in User class and @ManyToMany(mappedBy="vehicle") in Vehicle class, Hibernate will create which of these tables?
A. User Details
B. Vehicle
C. Vehicle_UserDetails
D. UserDetails_vehicle
9
Which is the right way to use session.get() method?
A. user = (UserDetails) session.get(Userdetails.UsrId)
B. user = session.get(Userdetails.class, UsrId)
C. user = session.get(Userdetails.UsrId)
D. user = (UserDetails) session.get(Userdetails.class, UsrId)
10
user.setUserName("Test User");
session.save(user);
user.setUserName("Dev User");
will result in
A. Two user records, One with User Name as Test User, and another with UserName as Dev User
B. One user record with UserName as Dev User
C. One user record with UserName as Test User, since no save has been performed on the second user
D. Two user records, One with User Name as Test User, and another as blank record in anticipation of a save
11
Which of these is true of Hibernate Applications?
A. Database needs to be designed
B. JDBC Database needs to be configured
C. DAO Method is required to save object using SQL queries
D. Model Objects should be defined
12
A Value Object
A. Does not have meaning on its own without a parent object
B. Contains values for the attributes of a given object
C. Is used to pass an object as an argument to a function or method
D. None of the above
13
Restrictions are like comparisons in a Where Clause os an SQL Query. Which of these are Restrictions for a Criteria?
A. like
B. eq
C. isNull
D. sizeEq
14
Which of these are mandatorily to be executed for saving an object?
A. Obtain SessionFactory from supplied configuration file
B. Initiate Session from sessionFactory.getCurrentSession() and begin the transaction
C. Commit the transaction
D. Close the session
15
To prevent Hibernate from re-creating the database schema on startup, you need to
A. Set the property hbm2ddl.dbupdate to Create
B. Set the property hbm2ddl.dbupdate to Modify
C. Set the property hbm2ddl.auto to Update
D. Set the property hbm2ddl.auto to Modify
16
Projections are used
A. to forecast information based on a data series
B. for aggregating data
C. with Grouping functions
D. for pulling up a specific property of an object
17
In a SingleTable inheritance strategy, Hibernate will create
A. No table for base class since it is an abstract class and one single table for all the sub-classes put together
B. One table for the Base Class and one single table for all sub-classes put together
C. One single table for the base class and all the sub-classes put together
D. One table for Base Class and one table each for each of the sub-classes
18
CollectionId annotation is a feature of
A. JPA and Hibernate
B. Hibernate only
C. JPA only
D. None of the above
19
minUserId = "5 or 1=1" is a SQL injection on the function session.createQuery(" from Userdetails where UserId > " + minUserId), since
A. It is updating a String input field which is used as a parameter in the query
B. it fetches all records instead of only the intended records with UserId > 5
C. the query is built with a paramter
D. None of the above
20
If a UserDetails object had an embedded collection of addresses, then session.get(UserDetails.class,1) would fetch
A. All addresses associated with UserDetails
B. Only the first address in the list of addresses associated with UserDetails
C. Only the UserDetails data without any of the addresses
D. the nth address as per default specified in Hibernate Configuration File
 
Sam Swamy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can please some one help me on this.
 
Sheriff
Posts: 21997
107
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Sam Swamy wrote:...as i dont have enough time to study and answer


So you don't have time to study and answer, yet you expect others to do just that. That's not how we work here: you should Do Your Own Homework.
Besides, you will need to spend time to read through our answers; you could instead take that time to answer the questions yourself. We would then gladly help you with any actual questions that are remaining.

Sam Swamy wrote:can please some one help me on this.


Do you really expect answers within 10 minutes minutes. You should really learn that Patience Is A Virtue. I understand that you probably need an answer quickly, but everyone here is a volunteer, and nobody is being paid to visit every hour (not even staff).

On a final note, I'll move this thread to our ORM forum.
 
Sam Swamy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks . I do agree with your words.I have no idea on ORM hibernate and  due to this COVID  our project has ended and we are assigned this set of courses to complete within a couple of days.

I just posted to get some help to save my job as i m already try to solve other courses.
 
Hey, I'm supposed to be the guide! Wait up! No fair! You have the tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic