Shinu Pil

Greenhorn
+ Follow
since Sep 02, 2005
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shinu Pil

i resolved this pblm by giving
select abc from ABC ABC LEFT JOIN abc.device
right now i getting results when matching records found in both tables ,but if there is no empid is not in abc and records are in device it not displayed.....wht will do in this situation i tried right join also but no chance to get results.Any help really appreciated..
Hi

i have two tables abc and device









my mapping file of abc i added


<many-to-one name="device" class="com.model.device" cascade="all" >
<meta attribute="default-value">new Device()</meta>
<column name="deviceId" />
</many-to-one>
My requirement is that when user search for deviceName from the uI it will fetch data first table and corresponding employee id assigned.If it not assigned need to return null value

How written in hibernate....

i written sample query in mysql it will work fine but i donot know how convert thta into HQl
It is the mysql query




i wriiten corresponding hQL as

i got following exception

rg.hibernate.hql.ast.QuerySyntaxException: unexpected token: from near line 1, column 76 [ ]
org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54)
org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47)
org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:82)
org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:281)
org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:180)
org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:134)
org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)

please help on this
HI
I have two tables with device and transaction
Device Id of device is the foreign key of transaction

how write hql query Device Id not used in second table
My current hql query for device is

here searchCritiria1,searchCritiria2 column name and searchString1,searchString2 are parameters passed from UI
how i added these sql query to
please help
Hi all,
when i try to insert some data to the table abc

i have another table device



my mapping file of abc i added


when i try to insert into db using hibernate template.save i got
rg.springframework.dao.InvalidDataAccessApiUsageException: object references an unsaved transient instance - save the transient instance before flushing: com.tel.it.model.Employee; nested exception is org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: com.model.Employee
org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:654)
org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:793)
org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:664)
org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.

please help is ineed to mention all dependency of employee in abc mapping
Hi
i would like to insert into table using HQL query.I searched lot of net...but allinsert query are reference to another tavles
i would like to kno wwhat is hql query for

your help really appreciated
in my code ineed to send data using hidden field with spring bind tag,....my code is that
<spring:bind path="abc.Id">
<input type="hidden" id="Id" name="Id" value="<c:out value="${abc.Id}"/>" />

</spring:bind>
my page not laod and iget follwing exception in log
SEVERE: Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspTagException: Neither BindingResult nor plain target object for bean name 'abc' available as request attribute
at org.springframework.web.servlet.tags.BindTag.doStartTagInternal(BindTag.java:122)
at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79)
at org.apache.jsp.pages.hardware.allocateHardware_jsp._jspService(allocateHardware_jsp.java:140)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)

please help
7 years ago
Hi
i need to retrieve record from employee table with employeeName ="test" age ="25" date ="01-1-2012" whose all conditions met. here employee name,age ,date of joining comes from search functionality from jsp.(searchString1,searchString2,searchString3)
String searchCritiria1="employeeName"
String searchCritiria2="age"
String date="01-01-12"
this piece of query i tried for one condition met .it working fine,but i donot know HQLquery for the above conditions met



please help ..iam beginner in this

SHINU SHINU.R wrote:i have two mapping files Swon and project
these are the

and project


when i tried to delete the selected record using
getHibernateTemplate().delete(entity);

showing exception as
org.springframework.dao.InvalidDataAccessApiUsageException: object references an unsaved transient instance - save the transient instance before flushing: .it.model.Project;

i tried with cascade="all" not-null="false" but noluck
could any body help me as i am new to hibernate

i have two mapping files Swon and project
these are the

and project


when i tried to delete the selected record using
getHibernateTemplate().delete(entity);

showing exception as
org.springframework.dao.InvalidDataAccessApiUsageException: object references an unsaved transient instance - save the transient instance before flushing: com.tel.it.model.Project;

i tried with cascade="all" not-null="false" but noluck
could any body help me as i am new to hibernate