Anoop Krishnan

Ranch Hand
+ Follow
since May 03, 2001
Merit badge: grant badges
For More
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 Anoop Krishnan

I want to extend the Root Element in the JAXBgenerated code from ReutersPictureNewsAsComplexData.class .

I added the following global binding in the schema file

This creates the generated code

But it also add the super class extension on ReutersPictureNewsAsComplexData to all generated classes .

Is there a way to limit this only to the rot element level class.
Thank You Tim
But please note that this is a warning which I get when I run my ant task and there is nothing like "UTF-8" I used in my custom ant Task
I thought This is coming from the TrasformerFactory class that is why I replaced the built in TrasformerFactory to the one from Saxon this worked well with the built in xslt task but not in my custom implementation.

Could you tell me where can I see the the Java source code for the ant XSLT task.

12 years ago
In my ant build process I use two kinds of xslt transform. One is the built in ant task and another one is a custom task which I programmed my self.
I use jdk / jre 1.6
and I use saxon9ee.jar for xslt processing
When I use the built in ant task as given below everything looks fine.

In my custom ant task, which also does an xslt transform.
I get the transformer factory instance from net.sf.saxon.TransformerFactoryImpl.TransformerFactoryImpl (in the saxon9ee.jar) as given below

But this gives me a warning "Warning: encoding "UTF-8" not supported, using UTF-8"

Do you have an idea why and how can it be avoided ?
12 years ago
Use spring.jar may be there are missing dependencies which is actually causing this problem
12 years ago
Is it possible to find the ViewResolver reference from the ApplicationContext ?
My bean is an ApplicationContextAware bean .
I tried
but it didn't worked I got an empty map.
12 years ago

Please do not use SP for insert. it is not a Hibernate way.

You must map a DB table to a Java Bean
Add this mapping to your hibernate configuration
Use Hibernate Session's save method with an instance of your bean this will insert a row in your table
if you want to check for duplicates use get method to get an existing reference.
Please have a look at this My Sql table called ipdaily where column LAST_VISIT is a time stamp.

I want to achieve the following .
I want to sum HITS,VOLUME,PAGES grouped by DOMAIN and IP and want the Latest (most recent) time stamp
for the LAST_VIST for each group.

I thought I want to achieve the following sql query.

I tried the following in Hibernate code

Given below are the hibernate obejct mapping

But this doesn't do what I want.

I think I need to use some special sql Criteria. Can anybody tell me exactly what I should do ?
Did anybody looked to this problem
I want you to look to this simple insert mechanism using sql-insert and stored procedure.
I am using Hibernate 3 and MySql 5.5.8.

I have the following table HourOfTheDayDaily in my database webalizer

This table is related to the object in the hibernate config file as given below.

The following code will insert the object to the database

Now please read what I want to do. There can be more than one commit with the same primary key (Please note that my primary key is a composite key).
I want to do an insert on the first attempt that means if a record with the give primary key is not present yet in the table .
If there is a record present in the table I want update the table colums PAGES,HITS and VOLUME by adding the new values to the values in the table.
I tried INSERT ...ON DUPLICATE UPDATE but it will not work on records with composite primary key.
Next option was to use a stored procedure . So I prepared a stored procedure insertHourOfTheDay as given below.

My problem is Nothing happens when I run my code no data is inserted or updated and i get the following exceptions.


I am debugging this simple code for last three days and could not figure out any thing . Can any body help me.
I want to use INSERT ... ON DUPLICATE KEY UPDATE feature of MySql.
The best possible way to make use of this is to add the SQLInsert annotation to the Class.

I want o insert objects of to the table HourOfTheDayDaily .

The columns in my table HourOfTheDayDaily are domain,year,month,date,hour,pages,hits,volume
Where domain,year,month,date,hour will form the composite primary key of the table.

My object has a property called name which is a reference to this composite id object. pages,hits,volume are other properties of the class itself refers to ChronoStatisticalContextHour which has the properties domain,year,month,date,hour

In the ON DUPLICATE KEY UPDATE I want to change the values of pages,hits,volume in the table HourOfTheDayDaily to
pages = pages + HourOfTheDay.pages
hits= hits+ HourOfTheDay.hits
volume = volume + HourOfTheDay.volume

That is if the record with the given key already exist add the properties pages,hits,volume of the object HourOfTheDay
to the current column values columns pages,hits,volume of the table HourOfTheDayDaily

How is it possible to define this using SQLInsert annotation ?. Is it not possible via SQLInsert ?.
If not is there any way to achieve this with out writing a stored procedure.

The code above gives the result -4.9999999999883

But the code below gives the result -499999.99999883

The pattern ##0.## do not have any 'E' but still it is able find out the exponential representation when an 'E' is used , but it can not find the exponential representation when a 'e' is used.

but the code below works fine with both 'E' & 'e'

Do you have an explanation ?.

13 years ago

Bear Bibeault wrote:Why are you passing a Calendar object to the JSP in the first place? It's a computational class, not a display class. Convert the Calendar to a Date before you send it to the JSP.

Remember, whenever you find something that's hard to do in the JSTL or EL, it's a red flag that you're probably doing something wrong.

14 years ago
>>Remember, whenever you find something that's hard to do in the JSTL or EL, it's a red flag that you're probably doing something wrong.
Ok I agree. I have a Calendar object and I just want to display the full year , month and the date in the front end.
I extract the date from the calendar and you are telling me to use those deprecated methods of the Date in my JSP to get the full year , month and the date
14 years ago