Saturday, 28 April 2012

REMOVE ':' infront label in ExtJs

Normally in ExtJs  ' : ' will be displaying infront of label.we can remove that by giving by use of labelSeparator. or we can use any label separator as your wise

Example:


       new Ext.form.TextField({
id:applyId,
mode: 'local',
applyTo: applyId,
triggerAction : 'all',        
selectOnFocus:  true,
forceSelection: true,
                 labelSeparator: '  '

});

in that label separator you can give arrow mark ,dot,etc...

Wednesday, 28 March 2012

Comparing files of two folders in UNIX

Normally you can't find how many files are different in two folders.It is possible only less amount of  files inside of two folders.If number of file increase means we can't compare whether present in both folders.For that we use below the command .It shows how many files are present in folder1 not in folder2 same as vice-versa


 diff  -r  pathOfFolder1   pathOfFolder2

Example :
folder1 constains t1,t2 and
folder2 contains t1,t4  means that output will like this

Only in pathOfFolder1 : t2
Only in pathOfFolder2 : t4

Monday, 26 March 2012

callback function use in Ext.data.Store


        In ExtJs some application displaying value only at combobox sometime.Because of it take long time fetch label for that value from store .For that we can use setTimeout  function to solve this issue.But it is not proper way to solve this issue.Because time delay  differs based on different browser and browser version.
        Instand of setTimeout function we use "callback" function in "store.load" .This quickly fetch label for that value and displaying label value.

EXAMPLE:
         var testStore = new Ext.data.Store({
                 autoLoad: true,
                proxy: new Ext.data.HttpProxy({
                url: 'applicationURL'}),
                reader: new Ext.data.JsonReader({ root: 'rootElementOfJson'}, [{ name: 'value' }, { name: 'label'}])
     });

testStore.load({
callback: function(rec, options, success) {
Ext.getCmp('comboFieldId').setValue(document.getElementById('fileldId').value);
}

callback function is applicable for only proxy method of store loading

Wednesday, 29 February 2012

EXPLAIN keyword Usage in SQL

The SQL compiler can capture information about the access plan and environment of static or dynamic SQL statements. The captured information helps you understand how individual SQL statements are executed so that you can tune the statements and your database manager configuration to improve performance.

You collect and use explain data for the following reasons:
  • To understand how the database manager accesses tables and indexes to satisfy your query
  • To evaluate your performance-tuning actions
In Front Any SQL Query just Give EXPLAIN key word . That shows the following things .That Based On how many Table using





   

Friday, 17 February 2012

Setting Eclipse Memory Size

You working in eclipse means  some time that hangs.Because of not enough memory. Initially in eclipse.ini file memory is like this

-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx 512m

that depend on different Operating System.

        Among other things, this sets the heap space to 40MB initially and a maximum of 512MB, and also specifies a maximum PermGen size of 256MB.

        A max heap of 512MB might be OK for some users, but it's often necessary to bump that value up for large project sets or when some third-party plugins are installed.

      So You need  increase memory size 1024MB.It enough for users.Or you increase above 1024MB.




-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx "YOUR MEMORY SIZE HERE "m

If you increase memory then eclipse works fine.








Thursday, 16 February 2012

How To String Concatenation with Null values in SQL?

Normally If You concate One String Value With NULL values means  That Returns NULL value only or some time that Query result not came.To Prevent this by use of  "ISNULL(....)"   Statement.


Example:

      SELECT  CONCAT(ID,ISNULL(NAME,' '))  FROM TABLE_NAME WHERE CONDITION

In that  ISNULL checks  the  NAME .The  Value of NAME  is  NULL means replace Empty String and  concat with ID and return result.Otherwise it returns Actual value of NAME and concat with ID and return result.

   You Can also use "COALESCE" instead of  "ISNULL" .Both Doing Same action only.

It also Work in HQL.





    

Monday, 9 January 2012

How to retrive data's in Many-to-Many Relationship using Hql?

You Can Retrive all data in Many-To-Many Relationship Using the following join Query

Hbm File is Like these


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
     
<hibernate-mapping>

<joined-subclass entity-name="test"
                 table="TEST"  dynamic-update="true" dynamic-insert="true">

<key column="ID"/>

<property name="name" type="string" column="NAME" />

<set name="assistantName"
        table="TEST_1"
       inverse="false"
       lazy = "false"
       cascade="none"
       sort="unsorted">
       <key column="ID"/>
       <element column="ASSISTANTNAME"  type="string"/>
        </set>
</joined-subclass>
</hibernate-mapping>



Use Of Following Hql  join Query  Retrive Both Table data TEST and TEST_1


     
select
        fetchInfo.id as id,
        fetchInfo.name as name,
        Test_1.id as assistantName
from
         test as fetchInfo join fetchInfo.test_1 as Test_1
where
         fetchInfo.id =:someValue