Prev Next

Hibernate / Hibernate interview questions

Difference between @NotNull, @NotEmpty and @NotBlank.


CharSequence, Collection, Map or Array object cannot be null, however can be empty.


The CharSequence, Collection, Map or Array object cannot be null and not empty (size > 0).


The string is not null and the length is greater than zero.

Here are the examples:

String test = null;
@NotNull: false
@NotEmpty: false
@NotBlank: false

String test = "";
@NotNull: true
@NotEmpty: false
@NotBlank: false

String test = " ";
@NotNull: true
@NotEmpty: true
@NotBlank: false

String name = "Some text";
@NotNull: true
@NotEmpty: true
@NotBlank: true

❤Cash Back At Stores you Love !!!❤

Earn your $10 reward when you make your first purchase through Ebates by signing up with clicking below button.

Ebates Coupons and Cash Back

More Related questions...

Difference between save and persist. @UniqueConstraint and @Column Unique attribute. What is HQL (Hibernate Query Language)? What are the most common methods of Hibernate configuration? In a Parent-child relationship, how will you only access the columns from parent? Difference between Hibernate createCriteria, createQuery, createSQLQuery. Difference between @NotNull, @NotEmpty and @NotBlank. Different between session.get() and session.load() in Java. What is ORM ? What is hibernate? What does ORM consists of ? @Repository @Embeddable @Service @Controller Differentiate JPA and hibernate. What are the ORM levels ? Why do you need ORM tools like hibernate? core interfaces of Hibernate. Is SessionFactory a thread-safe object? What role does the SessionFactory interface play in Hibernate? Is Hibernate Session a thread-safe object? What are the different states of object in hibernate? How to make a immutable class in hibernate? Different types of association in hibernate. Is it possible to perform collection mapping with One-to-One and Many-to-One? What is lazy loading in hibernate? What is the difference between merge and update ? How do you define sequence generated primary key in hibernate? What are the Collection types in Hibernate ? What is Hibernate proxy? What are Callback interfaces? What are the types of inheritance models in Hibernate? Benefits of hibernate over JDBC? Session Interface. SessionFactory Interface. Configuration Interface. Transaction Interface. Query and Criteria Interface. What are Callback interfaces? What is POJO? Detached Criteria Advantages of Detached criteria. Explain N+1 SELECT problem in Hibernate. List the strategies to eliminate the N+1 SELECT problem in Hibernate. Explain high level architecture of Hibernate framework. How do we see hibernate generated SQL on console? Hibernate: Can a Entity Class be declared final? How to call stored procedure in Hibernate? Explain transaction management in hibernate. Difference between fetch mode and fetch type in Hibernate. What is the default fetch mode in Hibernate? What is the difference between FetchType.LAZY and FetchType.EAGER in Java Persistence API? Difference between using a @OneToMany and @ElementCollection annotation in Hibernate. Explain the features introduced in Hibernate 5. Which throws Exception when no row found: session.load vs session.get.
Show more question and Answers...

Hibernate interview questions II

Comments & Discussions