Frameworks| Hibernate| Struts| JSF| JavaFX| Ajax| Spring| DOJO| JDO| iBatis| Questions? | Software Development
 

Hibernate Types

This section gives you description of all the Types that are supported by Hibernate. A Hibernate Type is used to map a Java property type to a JDBC type or types.

Hibernate Types

Back to Hibernate Tutorials Page

This section gives you description of all the Types that are supported by Hibernate. A Hibernate Type is used to map a Java property type to a JDBC type or types. 

The following tables to represents all Hibernate types:

Interfaces and Descriptions:
AbstractComponentType The AbstractComponentType enables other Component-like types to hold collections and have cascades, etc.
AssociationType This interface used to represent all associations between entities.
DiscriminatorType This interface used to discriminator properties with the help of right mapped subclass.
IdentifierType This interface has All identifiers of entities.
LiteralType This is a maker interface that which store SQL literals.
Type This interface describes mapping between the Java and JDBC datatypes
VersionType This interface used for version stamping.

 

Classes and Descriptions:
AbstractBynaryType The stream of byte bounded into a VAQRBINARY.
AbstractCharArrayType The stream of char bounded into a VARCHAR.
AbstractType This is a superclass that can be used for creating type hierarchy.
AdaptedImmutableType
AnyType It defines 'any' mappings and deprecated 'object' types.
AnyType.ObjectTypeCacheEntry
ArrayType It represents collection of data into a similar types.
BagType
BigDecimaType This class used to mapping between SQL NUMERIC and java.math.BigDecimal.
BigIntegerType This class used to mapping between SQL NUMERIC and java.math.BigInteger.
BinaryType It used to mapping between a SQL VARBINARY and a Java byte[]. 
BlobType It used to mapping between a SQL BLOB and java.sql.Blob.
BooleanType This class maps between SQL BIT and Java Boolean.
ByteType This class maps between SQL TINYINT  and Java Byte.
CalendarDateType This class represents a data and mapping into a Calendar object.
CalendarType It also represents a datetime mapping into a Calendar object.
CharacterArrayType It is a collection of VARCHAR like: Character[].
CharacterType This class mapping between a SQL CHAR and a Java Character.
CharArrayType It is a collection of VARCHAR like: char[].
CharBooleanType This is a superclass that can be mapping between SQL CHAR and Java boolean.
ClassType This class mapping between SQL VARCHAR and Java class.
ClobType This class mapping between SQL CLOB and java.sql.Clob.
CollectionType It handles the Hibernate PersistentCollections.
ComponentType This class mapping all components.
CompositeCustomType It adjusts CompositeUserType to Type interface.;
CurrencyType It is used to mapping a SQL VARCHAR into a java.util.Currency.
CustomCollectionType This class is created by users and implement the PersistentCollection.
CustomType It adjusts the user type to generic type interface and changes the internal type contracts.
DateType This class mapping between an SQL DATE to Java Date.
DbTimestampType  
DoubleType It can be used to mapping between SQL DOUBLE to Java Double.
EmbeddedComponentType  
EntityType It communicates an entity class.
FloatType It links SQL FLOAT to Java Float.
ForeignKeyDirection This class shows directionality of the foreign key constraint.
IdentifierBagType  
ImmutableType This is a superclass of the nullable immutable type.
IntegerType This class links between the SQL INT to Java Integer.
ListType  
LocaleType It links into an SQL VARCHAR and a Java Locale.
LongType This class links into an SQL BIGINT and a Java Long.
ManyToOneType It associates many-to-one entity.
MapType  
MetaType  
MutableType This is a superclass of mutable nullable types.
NullableType This is a supperclass of single-column nullable types.
OneToOneType It associates one-to-one entity.
OrderedMapType  
OrderedSetType  
PrimitiveType This is the superclass of primitive or primitive wrappers types.
SerializableType This class maps an SQL VARBINARY to a serializable Java object.
SetType  
ShortType It communicates between an SQL SMALLINT and Java Short.
SortedMapType  
SortedSetType  
SpacialOneToOneType  
StringType It communicates between an SQL VARCHAR and Java String.
TextType This class links between an SQL CLOB and Java String.
TimestampType This class mapping between an SQL TIMESTAMP and Java java.util.Date or java.sql.Timestamp.
TimeType It maps an SQL TIME to  Java java.util.Date or java.sql.Time.
TimeZoneType It communicates an SQL  VARCHAR to Java java.util.TimeZone.
TrueFalseType This class maps an SQL CHAR to a Java Boolean.
TypeFactory This class used internally and holds an instance of Type.
WrapperBinaryType  
YesNoType It maps between an SQL CHAR to Java Boolean.

 

Exceptions and Descriptions:
SerializationException This exception occurs when the property could not be serialized or deserialized.
» View all related tutorials
Related Tags: java c database xml hibernate reflection com file ide class files orm table data development process form time object diff

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

4 comments so far (
post your own) View All Comments Latest 10 Comments:

Can a collection reference be created in hibernate to handle the mappings or do we require to create a specific set/map/list. Can that option be left for runtime?

Posted by raghu on Thursday, 08.30.07 @ 12:32pm | #24490

Hey I am trying to Use the TextType in order to convert Java String to Oracle.sql.blob .....I am getting Oracle type mismatch exp.....I have also upgrade the jdbc drivers from 9i to 10g....I have tried implementing the UserType interface to create a seperate type but with no sucess ....If anybdy is aware of solution to this problem please let me know

Posted by Opatkar on Tuesday, 07.24.07 @ 20:31pm | #21854

in hbm.xml file , how can i use array?
where name is used as array of object in a dto class

Posted by parama on Wednesday, 05.30.07 @ 18:53pm | #17742

Hi Guys, i am facing this net.sf.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or Unsaved-value mapping was incorrect) for sg.gov.moe.rm.edusave.persistence.WDByActBatch instance with identifier 7118-200704-W000003.

WDByActBatch extends persistent object class.

Could anyone highlight, what could be the actual reason of exception and under what circumstances this exception is thrown? what is the best way to solve this?

I am using the following hibernate mapping

<class name="sg.gov.moe.rm.edusave.persistence.EduBatch"
table="RM_EDU_BATCH">
<id name="batchID" column="BATCH_ID" type="java.lang.String">
<generator class="assigned" />
</id>


<version name="version" column="VERSION_NO"
type="java.lang.Short" />

<property name="batchTypeCode" column="BATCH_TYPE"
type="java.lang.Integer" />
<property name="batchStatusCode" column="STATUS_CODE"
type="java.lang.Integer" />
<property name="manual" column="MANUAL_FLAG" type="yes_no" />
<property name="deleteFlag" column="DELETE_IND" type="yes_no" />
<property name="createdBy" column="CREATED_BY" length="20"
type="java.lang.String" not-null="false" />
<property name="createdDate" column="CREATION_DATE"
type="java.util.Date" not-null="false" />
<property name="lastUpdatedBy" column="LAST_UPDATED_BY"
length="20" type="java.lang.String" not-null="false" />
<property name="lastUpdatedDate" column="LAST_UPDATED_DATE"
type="java.util.Date" not-null="false" />
<property name="schoolCPCode" column="SCHOOL_CODE" length="10"
type="java.lang.String" not-null="false" />
<joined-subclass
name="sg.gov.moe.rm.edusave.persistence.WDByActBatch"
table="RM_EDU_WD_BY_ACT_BATCH_HDR">
<key column="BATCH_ID" />


<component name="program"
class="sg.gov.moe.rm.edusave.persistence.Program">
<property name="enrichProgCat"
column="ENRICHMENT_PROG_CAT" />
<property name="progTitle" column="PROGRAMME_TITLE" />
<component name="act"
class="sg.gov.moe.rm.edusave.persistence.Activity">
<property name="actCode" column="activity_code" />
<property name="catCode" column="category_code" />

</component>
</component>
<set name="wdByActBatchDtls" cascade="delete">
<key column="BATCH_ID" />
<one-to-many
class="sg.gov.moe.rm.edusave.persistence.WDByActBatchDtl" />
</set>
<property name="createdBy" column="CREATED_BY" length="20"
type="java.lang.String" not-null="false" />
<property name="createdDate" column="CREATION_DATE"
type="java.util.Date" not-null="false" />
<property name="lastUpdatedBy" column="LAST_UPDATED_BY"
length="20" type="java.lang.String" not-null="false" />
<property name="lastUpdatedDate" column="LAST_UPDATED_DATE"
type="java.util.Date" not-null="false" />
<property name="versionN" column="VERSION_NO"
type="java.lang.Short" />
</joined-subclass>
</class>

Thank you,
Srinivas.

Posted by Srinivas Babu Cherlam Cherla on Wednesday, 04.4.07 @ 09:21am | #13312

 
Tell A Friend
Your Friend Name

 

 
Recently Viewed
Software Solutions
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.