Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!

Reddy Prashanth

Ranch Hand
+ Follow
since Aug 09, 2005
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Reddy Prashanth

I do have same questions in my mind. Looking forward for any suggestions.
Your domain class name is "Contact"

But your query shows "contacts". Change it to use "Contact". It will work. We have to use mapped java class name, not table name in the HQL


Looks this is the first message in Gemfire forum.
could someone please advice here. I am using Gemfire v6.5.

I have two different cache servers running on two different machines. These two are not related to each other. Lets say one is PRODUCT cache and the other is PRICE cache.
Now I have a client application, which need data from both cache servers.

I could create a distributed system and connect to the first cache, but while trying to connect to second cache, it says, there is already a distributed system exists.
As per documentation we can have only one distributed system per VM. How can I get the data from both the caches simultaneously.
8 years ago
See the difference .. both are not same

private String qualifiaction;

<property name="qualification"/>

Can you post your code here. I suspect, the below property is missing in the java class.

<property name="qualification"/>
In your hibernate.cfg.xml file, below line is not valid.
<mapping class="com.Person.hbm.xml"/>

For class attribute, use class name as below
<mapping class="com.fooPackage.AnotherModelClass" />

Or, use
<mapping resource="com/Person.hbm.xml"/>

Also, if you already mention the mapping file name or class name in the hibernate.cfg.xml, then below line is redundant.
Configuration cfg = new Configuration().addResource("person.hbm.xml").configure();
In your query use "where billingaddress.memberid =?" instead of "where memberid =?"
Each hibernate session has an implicit cache associated with it and is valid as long as the session is open. This is called first level cache. Hibernate use this cache to store all operations and entity states so that, it will execute the sql queries as late as possible (at the flush time, by default).

Similarly, at the session factory level, we can configure a cache and it is available to all the sessions that are opened using that session factory. If configured properly, it will increase the application performance. There are various cache providers supported by hibernate for this (ehcache, jboss cache..etc). If a particular entity is not in the first level (session level) cache, then hibernate will consult the second level cache, and it will reach the DB only when the entity is not available in second level cache also. You can enable this second level cache per Entity, per collection or even per query basis (query results will be cached).

Check in hibernate reference documentation or google it. You can find many examples on how to configure second level cache.
Hope this helps you.
In your mapping file, ScreenTb class has a one-to-many relation with AccessTb class. But in the, you are trying to save string objects in the set instead of

When you save screenTB, hibernate also will try to save accessTbs colleaction (cascade effect). But it will fail because , the collection contains Strings instead of our mapped entities (AcccessTb). Try to add AccessTB objects to the set and see.
I found answer to my question. Though I read the documentation before, I somehow overlooked.

"Command/form objects to bind parameters to: as bean properties or fields, with customizable type conversion, depending on @InitBinder methods and/or the HandlerAdapter configuration - see the "webBindingInitializer" property on AnnotationMethodHandlerAdapter. Such command objects along with their validation results will be exposed as model attributes, by default using the non-qualified command class name in property notation (e.g. "orderAddress" for type "mypackage.OrderAddress"). Specify a parameter-level ModelAttribute annotation for declaring a specific model attribute name."

Thank you !!
10 years ago
I am sorry.. It was a typo. I am using spring 3.0.4 version.
My question is :

Does it mean, if we dont use any @ ModelAttribute annotation, by default will it use my command type as name ?? Can someone help me to understand this clearly.

In my code , for the processSubmit() method, I am not using any @ModelAttribute annotation (at parameter level or at the method level). Still my model is available in the pizzasuccess.jsp view page (under request scope with name "pizza"). I am not using this "pizza" name anywhere in my controller.

Can someone explain me how this happens ? If this is default behavior, when we need to use @ModelAttribute annotation.
Hope this time, my question is clear

10 years ago
Hi ,
I am trying to learn spring annotation in MVC. I am using spring 3.4 version. I am not using any @ModelAttribute annotation for the method parameters in my controller processSubmit() method. But still , in the final result page (pizzaSuccess.jsp here), my command object is bound in the request scope with a name "pizza". Plese note that , i am not using the name "pizza" anywhere in my controller. My command object is of type "Pizza".

Does it mean, if we dont use any @ ModelAttribute annotation, by default will it use my command type as name ?? Can someone help me to understand this clearly.

Below is my controller code :
10 years ago
If you want portability for your application across different JPA implementations and do not want to couple your application with Hibernate api, you can use JPA. Also, it is alway a good idea to use JPA. But hibernate has some additional features which are not part of JPA specification (ex: Criteria Queries and Query By Exmaple)
Hibernate is an ORM framework by its own and also it supports JPA specification. You dont need to use JPA if you dont want. Hibernate will persists your POJOs.

So you can use Hibernate as it is or you can use JPA in your application, leveraging hibernate's JPA implementation.
In hibernate applications, we mention pojo-table mapping details in *.hbm files or use Hibernate annotations.
In JPA, we mention the mappings in perssitence.xml or use JPA annotations.

JPA annotations are subset of hibernate annotations.
Yes. You can mention all the mappings in the persistence.xml file in JPA.