Primitive Types

Mapping typeJava typeANSI SQL Type
integerint or java.lang.IntegerINTEGER
longlong or java.lang.LongBIGINT
shortshort or java.lang.ShortSMALLINT
floatfloat or java.lang.FloatFLOAT

What are types of inheritance in Hibernate?

Hibernate supports the three basic inheritance mapping strategies:

  • table per class hierarchy.
  • table per subclass.
  • table per concrete class.

How many types of association mapping are possible in Hibernate?

Following are the four ways in which the cardinality of the relationship between the objects can be expressed. An association mapping can be unidirectional as well as bidirectional….Association Mappings.

Sr.No.Mapping type & Description
2One-to-One Mapping one-to-one relationship using Hibernate

What are the annotations used in Hibernate?

Hibernate JPA Annotations – Contents:

AnnotationPackage Detail/Import statement
@Entityimport javax.persistence.Entity;
@Tableimport javax.persistence.Table;
@Columnimport javax.persistence.Column;
@Idimport javax.persistence.Id;

What are mappings in Hibernate?

hibernate mappings are one of the key features of hibernate . they establish the relationship between two database tables as attributes in your model. that allows you to easily navigate the associations in your model and criteria queries.

What is Hibernate inheritance?

Hibernate Single Table Strategy. @Inheritance – It is used to define the type of inheritance used in hibernate and it is defined in the parent class. If the Inheritance annotation is not specified or if no inheritance type is specified for an entity class hierarchy, the SINGLE_TABLE mapping strategy is used.

What are the association mappings in hibernate?

Association mappings are one of the key features of JPA and Hibernate. They model the relationship between two database tables as attributes in your domain model. That allows you to easily navigate the associations in your domain model and JPQL or Criteria queries.

What is @basic annotation in hibernate?

sql. Timestamp, byte[], Byte[], char[], Character[], enums, and any other type that implements java. io. Serializable. The use of the Basic annotation is optional for persistent fields and properties of these types.

What is @entity annotation in hibernate?

@Entity annotation marks this class as an entity. @Table annotation specifies the table name where data of this entity is to be persisted. If you don’t use @Table annotation, hibernate will use the class name as the table name by default. @Id annotation marks the identifier for this entity.