The type ServiceRegistryBuilder is deprecated

Ads
 

The type ServiceRegistryBuilder is deprecated

I am trying to Create the SessionFactory in Hibernate using following code:

Configuration configuration = new Configuration();
configuration.configure();
serviceRegistry = new ServiceRegistryBuilder().applySettings(
        configuration.getProperties()).buildServiceRegistry();
sessionFactory = configuration.buildSessionFactory(serviceRegistry);

It's giving the following error:

The type ServiceRegistryBuilder is deprecated

What is the correct way of creating the SessionFactory in Hibernate 4.3 release.

Thanks

View Answers

February 2, 2014 at 1:09 PM

Hi,

Many API's are depricated in the Hibernate 4.3.x and the way of creating the SessionFactory is also changed.

So, you should use the latest way of creating the SessionFactory.

Check at Hibernate 4 Hello World: Example of Hello World program

Thanks

Ads









Related Tutorials/Questions & Answers:
The type ServiceRegistryBuilder is deprecated
The type ServiceRegistryBuilder is deprecated  I am trying to Create...(serviceRegistry); It's giving the following error: The type ServiceRegistryBuilder... ServiceRegistryBuilder().applySettings( configuration.getProperties
The method buildServiceRegistry() is undefined for the type ServiceRegistryBuilder
() is undefined for the type ServiceRegistryBuilder" in Hibernate 4.3.1? I am using...() is undefined for the type ServiceRegistryBuilder How to solve the issue? Thanks  ...The method buildServiceRegistry() is undefined for the type
Advertisements
standard serviceregistrybuilder example
standard serviceregistrybuilder example  can any one share me the standard serviceregistrybuilder example code? My project is in Hibernate 4.3.1.... serviceregistrybuilder for creating SessionFactory with the help of example code. Thanks
What is deprecated?
What is deprecated?  What is mean by deprecated element, method or class?   What is deprecated? Deprecated means condemned. A object... is showing a deprecated message that means it is either outdated or has been
Annotationconfiguration deprecated and its replacement
Annotationconfiguration deprecated and its replacement  Hi, In Hibernate 4 annotationconfiguration is deprecated. Can you tell me what will be its...(); serviceRegistry = new ServiceRegistryBuilder().applySettings
MPMoviePlayerContentPreloadDidFinishNotification' is deprecated
MPMoviePlayerContentPreloadDidFinishNotification' is deprecated  Hi, While compiling compiler is giving following error: warning: 'MPMoviePlayerContentPreloadDidFinishNotification' is deprecated (declared at /Developer
org.hibernate.dialect.PostgreSQLDialect is deprecated
org.hibernate.dialect.PostgreSQLDialect is deprecated  HI, org.hibernate.dialect.PostgreSQLDialect is deprecated Which dialect to use? Thanks   Hi, You can use any of the following
org.hibernate.dialect.PostgreSQLDialect is deprecated
org.hibernate.dialect.PostgreSQLDialect is deprecated  HI, org.hibernate.dialect.PostgreSQLDialect is deprecated Which dialect to use? Thanks   Hi, You can use any of the following
org.hibernate.dialect.PostgreSQLDialect is deprecated
org.hibernate.dialect.PostgreSQLDialect is deprecated  HI, org.hibernate.dialect.PostgreSQLDialect is deprecated Which dialect to use? Thanks   Hi, You can use any of the following
UIKeyboardBoundsUserInfoKey is deprecated
UIKeyboardBoundsUserInfoKey is deprecated  On running my application i am getting a warning as given below... " UIKeyboardBoundsUserInfoKey is deprecated " What is the cause of it?? and what should i use instead
UILineBreakModeWordWrap is deprecated
UILineBreakModeWordWrap is deprecated  I am getting the error UILineBreakModeWordWrap is deprecated in IOS 6.0. What is the latest code to be used for this? Thanks   Hi, If you use the following code
float to np.floating is deprecated
and there is warning message "float to np.floating is deprecated". Error is: C...` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`. from ._conv import register_converters as _register_converters
ModuleNotFoundError: No module named 'Deprecated'
ModuleNotFoundError: No module named 'Deprecated'  Hi, My Python... 'Deprecated' How to remove the ModuleNotFoundError: No module named 'Deprecated' error? Thanks   Hi, In your python environment you
Java making a method deprecated
Java making a method deprecated  java making a method deprecated...; Declare "@Deprecated" before a method to create a method deprecated in your Java application. Though, it is not a correct way to use a deprecated class
HTTP_POST_VARS is deprecated
HTTP_POST_VARS is deprecated  HTTPPOSTVARS is deprecated. Which function to be used? Thanks   Hi, You should use: $id=$_GET["id"]; or $id=$_POST["id"]; thanks
Function split() is deprecated
Function split() is deprecated  Hi, The Function split() is deprecated in latest version of PHP 5.5.23? What is the solution? Thanks   Hi, Use the following function: array explode ( string $delimiter , string
Version of cocoon>cocoon-deprecated dependency
List of Version of cocoon>cocoon-deprecated dependency
ModuleNotFoundError: No module named 'lookerapi-deprecated'
ModuleNotFoundError: No module named 'lookerapi-deprecated'  Hi...: No module named 'lookerapi-deprecated' How to remove the ModuleNotFoundError: No module named 'lookerapi-deprecated' error? Thanks   Hi
ModuleNotFoundError: No module named 'lookerapi-deprecated'
ModuleNotFoundError: No module named 'lookerapi-deprecated'  Hi...: No module named 'lookerapi-deprecated' How to remove the ModuleNotFoundError: No module named 'lookerapi-deprecated' error? Thanks   Hi
ModuleNotFoundError: No module named 'lookerapi-deprecated'
ModuleNotFoundError: No module named 'lookerapi-deprecated'  Hi...: No module named 'lookerapi-deprecated' How to remove the ModuleNotFoundError: No module named 'lookerapi-deprecated' error? Thanks   Hi
ModuleNotFoundError: No module named 'Python-Deprecated'
ModuleNotFoundError: No module named 'Python-Deprecated'  Hi, My... named 'Python-Deprecated' How to remove the ModuleNotFoundError: No module named 'Python-Deprecated' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'Python-Deprecated'
ModuleNotFoundError: No module named 'Python-Deprecated'  Hi, My... named 'Python-Deprecated' How to remove the ModuleNotFoundError: No module named 'Python-Deprecated' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'uno-deprecated'
ModuleNotFoundError: No module named 'uno-deprecated'  Hi, My... named 'uno-deprecated' How to remove the ModuleNotFoundError: No module named 'uno-deprecated' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'webmocker-deprecated'
ModuleNotFoundError: No module named 'webmocker-deprecated'  Hi...: No module named 'webmocker-deprecated' How to remove the ModuleNotFoundError: No module named 'webmocker-deprecated' error? Thanks   Hi
Is buildSessionFactory() deprecated in hibernate 4?
Is buildSessionFactory() deprecated in hibernate 4?  Hi, I am trying to develop an application in Hibernate 4. I am using the Hibernate 4.3.0.final build. Following code is given is the Hibernate documentation: SessionFactory
Function mysql_db_query() is deprecated
Function mysql_db_query() is deprecated  Hi, In latest version of PHP Function mysqldbquery() is deprecated. What could be the solution? Thanks
Function mysql_db_query() is deprecated
Function mysql_db_query() is deprecated  Hi, In latest version of PHP Function mysqldbquery() is deprecated. What could be the solution? Thanks
dismissmodalviewcontrolleranimated first deprecated in ios 6.0
dismissmodalviewcontrolleranimated first deprecated in ios 6.0  ...: dismissmodalviewcontrolleranimated first deprecated in ios 6.0 I used the following...   This error is coming as this code is deprecated in the IOS 6. You
ModuleNotFoundError: No module named 'django-deprecated-fbv'
ModuleNotFoundError: No module named 'django-deprecated-fbv'  Hi...: No module named 'django-deprecated-fbv' How to remove the ModuleNotFoundError: No module named 'django-deprecated-fbv' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-formwizard-deprecated'
ModuleNotFoundError: No module named 'django-formwizard-deprecated'  ...: No module named 'django-formwizard-deprecated' How to remove the ModuleNotFoundError: No module named 'django-formwizard-deprecated' error
ModuleNotFoundError: No module named 'django-markup-deprecated'
ModuleNotFoundError: No module named 'django-markup-deprecated'  Hi...: No module named 'django-markup-deprecated' How to remove the ModuleNotFoundError: No module named 'django-markup-deprecated' error? Thanks  

Ads