Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Chandra Sekhar

Ranch Hand
+ Follow
since Sep 26, 2003
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 Chandra Sekhar

"Inheritance allows you to restrict the behavior of objects."

Is this statement correct. Please calrify.


Version of Portal Server is 6.0

I'm getting ClassCastException. Thats where i'm stuck.

Anyway i'll check the logs again.

[ July 08, 2008: Message edited by: Chandra Sekhar ]
13 years ago

I'm trying to deploy an application devleoped using JSF-Portal combitaion intially developed for WebSphere Application Sever (WAS) 5.1 on WAS 6.0.

For JSF we are using MyFaces-Tomahawk implemention version 1.1.5.

Also now I'm using RAD 7.0 for development. Initially I got exceptions related conflict between to JSF RI and My Faces implementation.

Then I followed the steps here and remvoed jar files from WAS.

My Portlet class is like as below

public class MyPortlet extends MyFacesGenericPortlet { /// }

Now I'm getting ClassCastException.

Please help me to resolve this issue.

13 years ago
I'm not sure whether this will solve your problem.

To set default value to a column , I had done like this before.

<property name="price" type="string" formula="CASE WHEN (COALESCE(ITEM_CST,0) = 0) THEN ' ' ELSE CHAR(ITEM_CST) END"/>

addClass will try to read a mapping from an application resource, using a convention.

Ex.The class is mapped by the file foo/bar/Foo.hbm.xml.

When i changed my version to hibernate3.2 its working.

Chandrasekhar S

While triying to execute an update query using native SQL ,i'm getting an exception as follows.

java.lang.UnsupportedOperationException: Update queries only supported through HQL at org.hibernate.impl.AbstractQueryImpl.executeUpdate(

My code is like

I can change to HQL, but I like to know why this exception is thrown.

Why is native SQL for update not supported by Hibernate.

Thanks in Advance
Chandrasekhar S

I need to show tool tip for 'select' component in my HTML page.
Here is my code.

But Tool tip is not shown in Internet Explorer.But its working fine in Fire Fox.I'm working with IE 6.

Is this a known issue.Please let me know if there is any work around for this.

Thanks In Advance
Chandrasekhar S.

You can run some obfuscator tools to prevent reverse engineering.

This may help you
15 years ago

Please help me in writing HQL delete query.

My entity Class is like this

public class FunctionResourcePermissionData implements {
// Fields
private FunctionResourcePermissionId id;
private CompositeResourceData resourceObject;
private FunctionData function;
private String permissionCode;
private Date recordCreationTimestamp;
private String recordCreationUserId;
private Date lastUpdateTimestamp;
private String lastUpdateUserId;

The Id class is

public class FunctionResourcePermissionId implements {
// Fields
private Integer elementaryResourceId;
private Integer compositeResourceId;
private Integer functionId;

Mapping file is as below.

<class name="" table="FUNC_RSRC_PRMSN">
<composite-id name="id" class="">
<key-property name="elementaryResourceId" type="integer">
<column name="RSRC_ID" />
<key-property name="compositeResourceId" type="integer">
<column name="CMPST_RSRC_ID" />
<key-property name="functionId" type="integer">
<column name="FUNC_ID" />
<many-to-one name="resourceObject" class="" update="false" insert="false" fetch="select">
<column name="CMPST_RSRC_ID" not-null="true" />
<column name="RSRC_ID" not-null="true" />
<many-to-one name="function" class="" update="false" insert="false" fetch="select">
<column name="FUNC_ID" not-null="true" />
<property name="permissionCode" type="string">
<column name="PRMSN_CD" length="10" not-null="true" />
<property name="recordCreationTimestamp" type="timestamp">
<column name="RCRD_CRTN_TMS" length="26" not-null="true" />
<property name="recordCreationUserId" type="string">
<column name="RCRD_CRTN_USR_ID" length="8" not-null="true" />
<property name="lastUpdateTimestamp" type="timestamp">
<column name="LST_UPDT_TMS" length="26" not-null="true" />
<property name="lastUpdateUserId" type="string">
<column name="LST_UPDT_USR_ID" length="8" not-null="true" />

The query i wrote to delete is as

.createQuery("delete from FunctionResourcePermissionData " +
" where id.elementaryResourceId=:elemRes" +
" and id.compositeResourceId=:compRes " +
" and id.functionId=:fnId")

I'm getting the following exception
org.hibernate.exception.SQLGrammarException: could not execute update query
at org.hibernate.exception.SQLStateConverter.convert(
at org.hibernate.exception.JDBCExceptionHelper.convert(
at org.hibernate.hql.ast.UpdateStatementExecutor.execute(
at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(
at org.hibernate.impl.SessionImpl.executeUpdate(
at org.hibernate.impl.QueryImpl.executeUpdate(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at junit.framework.TestCase.runTest(
at junit.framework.TestCase.runBare(
at junit.framework.TestResult$1.protect(
at junit.framework.TestResult.runProtected(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
Caused by: [IBM][CLI Driver][DB2/LINUX] SQL0206N "FUNCTIONRE0_.RSRC_ID" is not valid in the context where it is used. SQLSTATE=42703

at Source)
at Source)
at Source)
at Source)
at Source)
at org.hibernate.hql.ast.UpdateStatementExecutor.execute(
... 18 more

The query generated by hibernate is

Hibernate: delete from EPDS.FUNC_RSRC_PRMSN where functionre0_.RSRC_ID=? and functionre0_.CMPST_RSRC_ID=? and functionre0_.FUNC_ID=?

In the query the alias name functionre0_ is not there after the table name ,but before field names the alias name is added.

Can some one help me to solve this issue.

Thanks in Advance
yes its "Our" group.

hi Santhosh,

Include me also in your study group.I do have copy of HFSJ.

Chandra Sekhar

Originally posted by Satou kurinosuke:
I think that it is to support older version (JSP1.1) where there was no hyphen.

Thanks for your reply.

What abt short-name ,thats also optional now in 1.2 rght?

thanks again
Please calrify my doubts

the 'taglib' element XML descrpition is given as

<!ELEMENT taglib (tlib-version, jsp-version, short-name,
uri?, display-name?, small-icon?, large-icon?,
description?, validator?, listener*, tag+) >

Here short-name is mandatory,but my TLD works with out that.Is
short-name attribute not mandatory?

(2) As per the 'tag' element description

<!ELEMENT tag (name, tag-class, tei-class?, body-content?,
display-name?, small-icon?, large-icon?,
description?, variable*, attribute*, example?) >

the element name is tag-class & body-content, but
tagclass,bodycontent (with out hyphen) also works.I'm sure something really wrong in my understanding as i'm not good in XML.
(i'm working in Tomcat 5).Please clarify my doubts.

Thanks In Advance