Anantha Sharma

Ranch Hand
+ Follow
since Sep 01, 2010
Anantha likes ...
Android Hibernate jQuery
Bangalore, India
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Anantha Sharma

you can use any ide (netbeans is good too), jQuery is a javascript library it allows you to write crossbrowser javascript effortlessly. you can use it to create frames (although not mandatory).
7 years ago
JSF
why don't you look at building a pattern
for example if you download an image from say google.com/images/foo/bar/mypic.jpg then you can store the files in a folder structure like /google-images-foo-bar/mypic-thumb.jpg

this way you'll be able to retrieve the weburl by simply analyzing the folder name.. again there are lots of things to be considered, like '-' in the URL etc.,

this could be a start for you to look at things differently...
9 years ago
looks like there is something wrong with your query.. can you try and execute the query in the db directly & check if its working fine...

also please post the full stack trace.. there must be a SQLException thrown which is not added as part of your post.
if you are using Criteria you can use projections to select only one field from the query,



if you are using HQL you can say

if you are looking to have a collection of Projects then you can use any of the collection Classes

you would require a class (POJO) to hold the Project (as you mentioned) & another class which has a collection class to hold Project objects.



// now you can add each individual project objects to the collection projectSet
9 years ago
you need to map the content as string not as a clop in hibernate... the documentation (links) has a sample program which cases a CLOB into a string...

that is the solution..


regarding the hibernate connection configuration & datasource... you need to make sure that the transaction manger used with the datasource is the correct one...
I understand your requirement, you need to say that its a clob but for hibernate you need to configure the field as String...

the post on the link contains a piece of code which does just that...
these are all the functions that hql is bundled with

http://docs.jboss.org/hibernate/core/3.3/reference/en/html/queryhql.html#queryhql-expressions

hql translates these into meaningful sql functions based on the dialect.

now, there are many scenarios where a database vendor (like oracle) would have created different functions which are not a part of the hql's expression, in those cases, you'd have to use the SQL function name directly in the HQL (jut like you created an SqlRestriction..

if you want to ensure that you don't use any db vendor specific functions you can always load data & work with it afterwards.. or you can create a database view & do all the activities there....
its always best to have a connection pool (preferably from a data source).. hibernate is not very good at managing connections (especially in a production environment).

you can use c3p0 (jar files comes with hibernate) for connection pooling if you can't create a datasource.

also if both the above options are not fesiable then try reading the following.

http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html (read section 3.4: optional configuration properties)

http://docs.jboss.org/hibernate/core/3.3/reference/en/html/architecture.html#architecture-current-session
if your table definitely has 5 records & hibernate is showing 4, then hibernate is only loading 4 entries (pretty obvious).. please check the generated SQL to findout if there are any specific conditions associated for the mapping file (probably at class level).

if you look at line 53


the system is complaining about a named query. please check its syntax.

hibernate parses all named queries while the system is starting up .. this way it can save time when the query is executed (as it doesn't have to parse it every time the query is run).
the book from Christian Bauer is the best on yet on hibernate..

you can visit hibernate support documentation for a more examples hibernate docs (3.3)

if that doesen't help please revert with the actual mapping you are trying to create & i'm sure we can help you with it.
you can set the loggin mode (if you are using log4j) to debug for org.hibernate to see when the connection is created & released.
try



you need to look at the collection mapping as a property & not a collection in the query...