Aby Krishna

Greenhorn
+ Follow
since Jul 10, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
3
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 Aby Krishna

old thread but same issue faced and same question. Any answers will be great.

Env: 10.3.5 WLS
9 years ago
It won't be cached unless you use the addScalar() or addEntity() methods.

Look: https://forum.hibernate.org/viewtopic.php?p=2373167
General understanding is that a Named Query (written in HQL or JPQL) is going to be optimized and converted to native sql dialect by the underlying persistence framework. A native query is something written in SQL dialect by you, over which the underlying persistence framework may not have control and hence may not be able to optimise or convert.

Further, from the hibernate spec:

You may also express queries in the native SQL dialect of your database. This is useful if you want to utilize database specific features such as query hints or the CONNECT BY option in Oracle. It also provides a clean migration path from a direct SQL/JDBC based application to Hibernate. Note that Hibernate allows you to specify handwritten SQL (including stored procedures) for all create, update, delete, and load operations (please refer to the reference guide for more information.)

From the description, it seems like it is actually a Many-To-Many relationship between the Order and Component. An order can have multiple components and a component can be in multiple orders.

If the understanding is correct, there should be bidirectional relationship, a Many-To-Many annotation on Order (owning side) and Many-To-Many on Component (inverse side). With that you could fetch components from order and orders from components.
Yes there are.
I use IntelliJ as IDE which allows generating entity classes (POJO's) from relational tables.

Google search threw up the following:

Generate entities from database tables (Eclipse)
Generate code with Hibernate tools
From 'JPA Class', I understand you want to test Entity classes.

How is this going to be different from unit testing your other classes. A junit testcase to test persisting and retrieving your entity should be just fine.
quite old..but one of the problem in the original poster's code is that the driver class string is incorrect.

OP's driver class string: com.microsoft.jdbc.sqlserver.SQLServerDriver
Correct driver class string: com.microsoft.sqlserver.jdbc.SQLServerDriver
I am not sure which is the right forum for a xsl related question (though still programming in Java).

But have a question about it: "How to traverse a recursive nodeset(depth unknown) in XSL ? say you have ?"
What i am trying to do is simply traverse the xml via xsl and creating xhtml out of it. However, the issue i have is, <xsl:for-each > works till just 1 level deep. How do i get recursive child nodes with the same name?

Any help is appreciated.

Thanks.
Hi,

I want to understand on why is it legal to call static methods via instance (object reference)? Say "myObjRef.myStaticMethod()", is allowed, but how does it work? A static method is at class level and hence the confusion i have.

Any thoughts would be highly appreciated.
13 years ago
Hi,
A quick question, what will happen if i invoke setName(String) API on a thread instance after it has been started via "start()". Will the name be at on the thread and printing it would print the new name? or the name can not be set after the thread has been started?
Hi,

I have this basic question, how is the following code able to access the instance variable even though its private? (the code compiles without any errors)


Please refer to line 10 of the code above,
So specifically, the question i have is: "is static main() method allowed to access private instance variable of the class just like any other instance method?". This is confusing me a bit.

Thanks.
13 years ago
Thanks, that was helpful.

Okay another question on the same topic:

Why does ArrayList implment List interface when AbstractList already implements List interface and is inherited by ArrayList?

I understand that not all methods from List are implemented in AbstractList, but since ArrayList extends AbstractList, all the method implementations and abstract declarations would be automatically inherited, in addition the abstract declarations would be mandatory to be implemented in ArrayList(unless ArrayList is declared abstract too).

Am i missing something? or is it again "for contract and convenience" purpose that List interface is implemented again in ArrayList?

13 years ago
Hi,

I am looking in to the source code for JDK (6.0), and have the following question over the List interface. Please clarify on what is wrong in my understanding.

List interface inherits Collection interface. Hence all the public/package-private methods declared in Collection interface would be inherited in the List interface and would be required to be implemented in the concrete implementation for List.

Then why is it required to declare the same methods in List interface which are already declared in Collection interface and inherited? (for eg: int size() and boolean isEmpty() are declared in the Collection interface and List interface both).

Your help is appreciated.

Thanks.
13 years ago