Java Spring Hibernate : How to make MySql group_concat, concat_ws work in Hibernate

I have an application where I am using spring Hibernate and my applicationContext.xml files looks like below. I want to use group_concat and concat_ws in Hibernate queries.


 <bean id="sessionFactory"
  class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  <property name="dataSource" ref="dataSource" />
  <property name="configLocation">
   <value>classpath:hibernate.cfg.xml</value>
  </property>
  <property name="configurationClass">
   <value>org.hibernate.cfg.AnnotationConfiguration</value>
  </property>

  <property name="hibernateProperties">
   <props>
    <prop key="hibernate.dialect">${jdbc.dialect}</prop>
    <prop key="hibernate.show_sql">true</prop>
   </props>
  </property>

 </bean>

Solution

Add a new java file somewhere in your solution. For example I am adding in the below package
com.myApp.util
Class Name : CustomDialect

package com.myApp.util;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.function.StandardSQLFunction;
import org.hibernate.type.StringType;
public CustomDialect(){
   registerFunction("group_concat", new StandardSQLFunction("group_concat", StringType.INSTANCE));
    registerFunction("concat_ws", new StandardSQLFunction("concat_ws", StringType.INSTANCE));
}

}

Update applicationConctext.xml like below

....
<props>
<prop key="hibernate.dialect">com.myApp.util.CustomDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
....





Lenovo Service Centers Hyderabad


Lenovo Tablets Service Center Hyderabad

6-3-679/1/201
Classic Emarald Apts
Punjagutta 
Hyderabad
Phone : 8832443314


7-1-58
Flat No 36
Divya Shakthi Apts
Opp. Lal Bungalow
Ameerpert 
Hyderabad
Phone : 8886675564

Google spreadsheet Hyperlink to a specific sheet in the same spreadsheet

I have a very big Google Spreadsheet where there are some 30 sheets. Now I want to mantain links to each and every sheet on first sheet. So when I click on a link on the first sheet it should open a specific sheet.

Putting a Hyperlink will open the sheet in New Broswer Tab.

In Order to accomplish this follow the below steps.

Here is my sample sheet























Now I want to add a link on 'Index' sheet which when clicked should take me to the desired sheet.

Step 1 :

Goto Insert --> Drawing

































Step 2 :

Type 2 , Resize it and click save and close











Position it properly on the sheet














Step 3:

Now click on 2 - you will see an arrow, click on it and select 'Assign Script'




Now type 'GotoSheet2' and click OK












Step 4:

Goto Tools --> Script Editor. If you see the below screen click 'Spreadsheet'. A script page is opened.






 














In the script window add the below code at the last line

function goToSheet(sheetName) {
  var sheet = SpreadsheetApp.getActive().getSheetByName(sheetName);
  SpreadsheetApp.setActiveSheet(sheet);
}
Once the above function is added now add your function 'GotoSheet2' assigned above and click Save
 
function GotoSheet2(){
  goToSheet('Sheet2');
} 
 The final code snippet looks as follows.























Repeat the above process for each and every link.

function goToSheet(sheetName) {
  var sheet = SpreadsheetApp.getActive().getSheetByName(sheetName);
  SpreadsheetApp.setActiveSheet(sheet);
} 
function GotoSheet2(){
  goToSheet('Sheet2');
} 

function GotoSheet3(){
  goToSheet('Sheet3');
} 

function GotoSheet4(){
  goToSheet('Sheet4');
} 


Here is the public link for the example project

https://docs.google.com/spreadsheets/d/19RZJkPWNQcgzlRYlkO9Z-UPaR9y6-h0NkXbhyZ6TmeA/edit?usp=sharing


ebay 100% working Coupons

I will post all working coupons. If someone uses the coupon, just post a comment so that I will remove it from here


ebay.in working coupon, 7% off or maximum of 750.
Valid Until Sep, 30 2014





How to remove Sweet-page.com virus

After installing camstudio, I noticed that all the browsers (Chrome, Firefox, Internet Explorer) started redirecting me to sweet-page.com website, I checked about this in internet and did everything they suggested. The things that I did were..

1. Remove Camstudio or other free software that caused sweet-page to enter into the computer
2. Remove any other software that was installed along with the free software
3. Open Firefox , Chrome, IE and remove any unwanted extensions
How to remove Chrome extensions or add-ons

How to remove Mozilla Firefox extensions or add-ons
How to remove IE Firefox extensions or add-ons

4. Right click shortcuts of Chrome IE Firefox and update their links. For example






























Even after updating everything, I have seen the browsers are not behaving properly, they are always redirecting to sweet-page. To fix this I have used RKill Software to fix all shortcuts

Download RKill

5. Fix Chrome/Firefox start pages

































6. Open Regedit and search for "Sweet-page" and modify the values of all the entries where you see Sweet-Page. Make it blank.
Right click on the key select modify and delete the value-data.

Some good tutorials from internet
http://www.bleepingcomputer.com/virus-removal/remove-sweet-page.com-browser-hijacker
http://malwaretips.com/blogs/sweet-page-com-removal/