Prasath Premkumar

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

Recent posts by Prasath Premkumar


Hi Prince,

I'm having the same problem with logging custom log messages in each exception occur. Did you find a solution for this problem?

Thanks in advance.
14 years ago

Hi,

I have to change the request url and forward it. For example i need to change all "/aaa/bbb/ccc/..." urls as "/aaa/ccc/..." ("/bbb" removed
from request url)and forward it. How can i do it without response.redirect in servlet ???

Can i do it with Struts 1???

Thanks in advance.
14 years ago

Hi,

I have a requirement to calculate the blue colored area in an JPG image. Can anyone suggest me a way to do this please???

References for any libraries or APIs are highly appreciated.

Thanks in advance.

Regards,
Prasath.
14 years ago

Hi all,

I have a confusion about iterating resultset.



If the above code segment checks for empty resultsets too, then whats the advantage of using,




Can anyone please explain this and what is the best way to do the iterating part?

Thanks in advance.

Hi all,

I heard that when we compare null to a value it is a good practice to do " if(null == value)" rather than
doing " if(value == null)" . But i didnt understand the reason behind it.

Can anyone please give an explanation for doing so???

Thanks.
14 years ago
Hi,

I was able to fix that issue. Thanks anyway.

If anyone wants to know what i did:



This HQL does what i needed.

Thanks.

Hi all,

I have a table named doc_type and another one named release. In doc_type.hbm.xml i have defined a many-to-one mapping for release like this:


note that DocType can be without release too.

I wrote a HQL like this for a scenario where i needed to get all the doctypes (with or without release) for a common name ordered by release.releaseOrder and issueDate.



But it didnt return DocTypes which dont have release. But when i removed from the order by clause, it returned all the doctypes with or without release object. (which is the expected behavior). So i found out that since i'm using an attribute of the Release object in HQL, when Release is null in DocType, it is not returning that record.

So i thought i can to a left join and wrote a HQL like this:



which returned everything but instead of returning a List, it resulted in List<List> something like that....

What is the possible HQL for this scenario???

Thanks in advance.
Hi,

Maybe my question is not clear to you all. In that case it will be much helpful if anyone can post me an example of how to insert values to a table which has foreignkey
reference from another table. I just want to find what is the best way to do it.

Thanks.

Hi all,

I'm new to hibernate. I started working on a Spring + hibernate project recently. Since I'm new to hibernate, i reversed engineered the DAOs from the database and went through them. I have 2 tables named user_roles and users in my database and the user_role_id column of users table references id column of user_roles table. (Foreign key constraint).

In the Users.java class i had all the setter methods to create a user object but no setters for user_role_id, instead of that there was a setter method for UserRoles object. So i thought to create a UserRoles object and set it so it will lookup and automatically assigns the id, but when creating the UserRoles object i found that it requires Set<Users> collection to be set since of the many to one relation. Nw I'm really confused how to insert a user record since there is a cyclic dependency in the classes. (I dont know whether this is the correct way, but since these are generated classes i thought this is the standard way to follow.)

Can anybody guide me how to insert a user record with user_role_id???

According to the rules of javaranch, i hereby inform that cross posting of this question is occuring here
and since i didnt get any help there (till this post occured), i decided to post in javaranch.

Thanks in advance.

Thanks for the replies. finally i got rid of that issue. The problem was with the textfield binding. Now my application works fine. From next time i will follow the things which have been mentioned by the experts.

15 years ago

Yeah, i got the point. I'm sorry that i didn't know about that. I have asked this question in one more place too. As i read from that link it says that if i didn't get answer from other places, i can ask here too but i should mention that crossposting is occurring. So i have accepted about the crossposting and if anyone is willing to answer now, it will be much helpful. Since this is an urgent issue, i had to ask this again without considering the time delay for the posts. If that doesn't matter too much, please provide me with the solution.

Thanks.
15 years ago

Hi,

Haven't anybody used JTextBox??? I need help urgently. Please post me a solution.

thanks.
15 years ago

Hi Michael,

Your simple solution is good.

I didnt get the point you have mentioned in your post regarding my post. Please give me the solution you know of.

Thanks.
15 years ago

Hi,

I'm new to Swing. I created a database application to search a text in the database and i use a jTextBox to enter the text. But now i have a problem in entering the values in
the text box since the value is typed reversely. When entering a character it goes in front of others without going to the last place.

For example if i enter as "table", it will be entered as "elbat". How can i resolve this issue?
I want to set it to the normal typing style.

Thanks in advance.
15 years ago

Thanks for the reply Igor.

If i'm using hibernate, where does EJB comes in and what are the purposes served by them each? And i didnt get the point you mentioned about POJOs with spring container to replace EJBs. Can you please give a small
explanation about what you said or provide me a link where i can learn about it?