Shubh Bhat

Ranch Hand
+ Follow
since Sep 08, 2002
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 Shubh Bhat

Hi all,
I am a Hibernate newbie. Had a simple task.


I am using the following mapping query and class:

<hibernate-mapping>
<class name="com.TableA" table="TableA">
<id name="id" column="id" type="string"></id>
<property name="fun"/>
<property name="foo"/>
</class>
</hibernate-mapping>

---
Query
----
SQLQuery q = this.sessionFactory.getCurrentSession().createSQLQuery(
"select {r.*}, b.rate from TableA r, TableB b " +
"where b.id=r.testId"
);


q.addEntity("r", TableA.class);
q.addJoin("b", "r.rate");
--
TableA class
---
Has all the setter and getter for, id, foo, fun AND ALSO rate



My task is:

1. when I fetch data, I do a join on two tables to get all the fields, lets say TableA & TableB.

2. when I update and save I just want to TableA to be updated.

From the above I get and error that rate is not mapped.
How do I put rate in the mapping and when I do an update I don't really affect TableB.

Shubhra
I need to run an external non-java application (from Swig) within my Ant script. Could you please direct me how to.

thanks in advance.
16 years ago
Hi all, below is the SOAP Response I get from a webservice
I need to access things inside #id0 and #id1. I am unable to get it.
I would need VBA specific code as an example.

Thanks in advance,
Shubhra

<?xml version="1.0" encoding="UTF-8" ?>
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <soapenv:Body>
- <ns1:getPositionsResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:com.ts.test.qs">
- <getPositionsReturn soapenc:arrayType="ns2:ArrayOf_xsd_anyType[2]" xsi:type="soapenc:Array" xmlns:ns2="http://qs.test.ts.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<getPositionsReturn href="#id0" />
<getPositionsReturn href="#id1" />
</getPositionsReturn>
</ns1:getPositionsResponse>
- <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3 roduct" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns3="http://qs.test.ts.com">
<name xsi:type="xsd:string">SecondName</name>
<description xsi:type="xsd:string">Desc</description>
<price xsi:type="xsd ouble">2345.6</price>
<asOfDate xsi:type="xsd ate">1969-12-31</asOfDate>
</multiRef>
- <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4 roduct" xmlns:ns4="http://qs.test.ts.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<name xsi:type="xsd:string">FirstName</name>
<description xsi:type="xsd:string">description</description>
<price xsi:type="xsd ouble">123123.13</price>
<asOfDate xsi:type="xsd ate">1969-12-31</asOfDate>
</multiRef>
</soapenv:Body>
</soapenv:Envelope>
16 years ago
Dear Ulf Dittmer,

I just have a simple bean (having more or less Strings as members) and I want to pass that to the VBA client. I know I can use struct. etc. however I am specifically looking for an Example or may be other ways to do it with a little code snippet.

I am pretty new to it, so most of the jargons doesn't mean much to me.

Thanks again!
16 years ago
Hi all,
I am able to pass an ArrayList of String, however I want to pass an array of bean object (java) to a vba client. Could you please help.

Do I have to write wsdl if so how etc. If you could even point me to the write document it would help.

Thanks in advance.
16 years ago
Can you please explain between throughput and response time.

Thanks,
Shubh
18 years ago
I don't get it at all! Can anyone explain?
Q:
The sendError method defined in the HttpServlet class is equivalent to invoking the setStatus method with the following parameter. Select the one correct answer.
1. SC_OK
2. SC_MOVED_TEMPORARILY
3. SC_NOT_FOUND
4. SC_INTERNAL_SERVER_ERROR
5. ESC_BAD_REQUEST
why should the answer for the above question be 3. and not 4?
Thanks in advance.
Isn't there any other way. Can't we do without try catch?
What happens if a static blocks throws an exception. How do I handle it? I know the code below won't compile, but do we have an alternative, to make it work.
ex.
public ClassXYZ
{
static
{
throw new Exception();
}
}
What I understand about static method is: we don't have to instantiate an object of a class (where the static method is) to call the static method.
But I have a lot of questions regarding it.
how are static methods handled in a multithreaded application?
I have a class ABC with a static method public static stat(ArrayList a). now assume there are more threads calling at the same time ABC.stat(a). What happens? have some threads to wait until the others have finished calling the method, or can static methods be multithreaded, (can they perform simultaniously)?
What really happens behind the sceen? I mean what happens in the memory level and so on.
If there is a good link where I can read some more things about static methods please post it as a reply, I would be more than happy to read it
19 years ago
What I understand about static method is: we don't have to instantiate an object of a class (where the static method is) to call the static method.
But I have a lot of questions regarding it.
how are static methods handled in a multithreaded application?
I have a class ABC with a static method public static stat(ArrayList a). now assume there are more threads calling at the same time ABC.stat(a). What happens? have some threads to wait until the others have finished calling the method, or can static methods be multithreaded, (can they perform simultaniously)?
What really happens behind the sceen? I mean what happens in the memory level and so on.
If there is a good link where I can read some more things about static methods please post it as a reply, I would be more than happy to read it
19 years ago
oops I mean SCJP not SJCP I guess I already forgot about the exam
19 years ago
I studied for just a week. During week days I used to be too tired to study after work, so all my effort was during weekend (total two weekends 8-10hrs on saturday and sunday).
I think its not tough at all..
good sources are:
Dan's mock exam
Java ranchers: they are awesome, guys belive me couldn't have done MUCH without them.
19 years ago
Exactly Barry that was my question.
Dan the questions are interesting, not to tough neither too easy, I think. I would only know how much it is closer to the real stuff, on wed. that's when I plan to take the exam 1.4.