Venkata Kumar

Ranch Hand
+ Follow
since Apr 16, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Venkata Kumar

Hi All,

I have two objects Person, Manager and the objects are mapped to database tables Person and Manager. I want to get all the persons having no manager at all or having manager whose name is "xyz".

SQL query to get the desired result is

I want to get the same result using HQL query and tried the following HQL query. But it is not giving expected results.


Any help on HQL query is appreciated.

Thanks,
Venkat



Thanks Eric. Changing the id to some other value worked.

Hi Guys,

I am developing a web application. In one jsp page i have to change the content in a table dynamically.

I tried both innerHTML and dom functions to change the table cell data. Both are not working.

When i click save button the div tags has to be populated with "testnode".

Anything wrong in my code? please help me.




Hi Jeanne,
I am using Mysql workbench to design database. Once the design is over i will generate tables using workbench and map the tables to java objects using JPA annotations.

Workbench is not allowing me to create GID as foreign key in Table 2 or Table3 because GID is not unique in Table1.

I have another approach in my mind.

Instead of keeping GID in table2 or table3 let the ID of table2 or table3 be as GID in table 1. The tables look like below

TABLE1
ID
GID ( which is either ID of table2 or table3)
ATTR

(ID,GID) is composite primary key

TABLE2
ID (PKEY)
ATTR1


TABLE3
ID (PKEY)
ATTR

In this case whenever i delete Table2 or Table3 row then i have to explicitly delete the corresponding ID entries in Table1.

Is this better approach than the previous one?

Which approach is more suitable when it comes ORM. Basically when ever the Table2 row is retrieved using java object then corresponding Table1 entries(if exists) should be loaded from database and be part of Table2 java object.

Thanks,
Venkat
Hello All,

I am designing a database for my Java web application. I am struck in establishing relationships between tables.
Example database tables are given below

TABLE1
ID
GID
ATTR

TABLE2
ID (PKEY)
ATTR1
GID of Table1

TABLE3
ID (PKEY)
ATTR
GID of Table1


Table1 has composite primary key(ID,GID). Table1 ID is unique. Table1 GID is used to group different rows of Table1 and this GID can be mapped either to Table2 row or Table3 row but not both (one to one mapping)
When Table2 or Table3 row is deleted then associated GID entries from Table1 should be deleted. This is not mandatory.

How can i relate Table2 and Table3 to Table1. Please suggest me if we can represent data in other better way.
Any help on this is highly appreciated.


Thanks,
Venkat



Please post your code using code tags. That will be helpful to analyze the problem
15 years ago
Both are same. When <jsp:forward> is translated to servlet then requestdispatcher is used to forward the request.
15 years ago
JSP
Please post complete jsp file contents which may be useful to analyze the issue.
15 years ago
The action GRNAction scope is request. When the jsp is rendered the contents of arraylist are displayed. But when you submit the form the arraylist is reinitialized and becomes empty. To fix the issue you may change scope to session.
For more info see here



15 years ago
Hi,

Is the requirement only for UK citizens?
The link doesn't mention about this.
15 years ago
Tomcat versions prior to 5.5.27 doesn't follow the quote requirements of Jsp Spec. Tomcat version 5.5.27 onwards quotes are checked strictly. Nested quotes has to be escaped.
what does MyPermissions.PERMISSION1 return?

<permissions:hasAnyNetworkSettings networkSettings="<%=MyPermissions.PERMISSION1%>">


You may use single quotes as shown below
15 years ago
The question is already answered in different post.
Please see the link https://coderanch.com/t/485716/Java-General/java/Creating-new-Strings#2182216

15 years ago

<xs:selector xpath="Address /country">
<xs:field xpath="." />



You may try this
XML parser can't parse special characters like &,< and < etc. "&" has to be represented as & amp; (no space between & and amp;)in order to be processed by DOM parser.
See xml specification http://www.w3.org/TR/REC-xml/#syntax for more info

Please use code tags to post your code.

Please post your corresponding struts.xml contents and jsp contents.

15 years ago