Registry type in Hibernate Mapping Types by R4R Team

Hibernate has some basic types of registry called Basic value types. We use its when that need to resolve the specific org.hibernate.type.Type to use in certain situations. By the using of this we foud the way for applications to add extra basic type registrations as well as override the standard basic type registrations.

When we need to register a new type or we want to override an existing type registration, application that would make use of the registerTypeOverride method of the org.hibernate.cfg.Configuration class when bootstrapping Hibernate. We can take to example to understand this if we want Hibernate to use custom SuperDuperStringType; during bootstrap that will call:

Example: By this small code of example we can do Overriding the standard StringType

Configuration cfg = ...;
cfg.registerTypeOverride( new SuperDuperStringType() );

In the above given code shows the argument to registerTypeOverride is a org.hibernate.type.BasicType which is a specialization of the org.hibernate.type.Type. That add a different method that given below:

Example: Snippet from

    public String[] getRegistrationKeys();
Leave a Comment:
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!