hibernate mappinigs

db queries
------------

  CREATE TABLE TEST1
   (    "ID" NUMBER NOT NULL ENABLE,
    "DESC" VARCHAR2(20 BYTE),
     CONSTRAINT "TEST1_PK" PRIMARY KEY ("ID")

   ) ;


  CREATE TABLE "SYSTEM"."TEST2"
   (    "T2ID" NUMBER NOT NULL ENABLE,
    "T1FKID" NUMBER NOT NULL ENABLE,
    "T2DESC" VARCHAR2(20 BYTE),
     CONSTRAINT "TEST2_PK" PRIMARY KEY ("T2ID")
      CONSTRAINT "TEST2_TEST1_FK1" FOREIGN KEY ("T2ID")
     REFERENCES TEST1 ("ID") ON DELETE CASCADE ENABLE
   );


  CREATE TABLE "SYSTEM"."TEST3"
   (    "T3ID" NUMBER NOT NULL ENABLE,
    "T11FK1D" NUMBER NOT NULL ENABLE,
    "T2FK1D" NUMBER NOT NULL ENABLE,
    "T3DESC" VARCHAR2(20 BYTE),
     CONSTRAINT "TEST3_PK" PRIMARY KEY ("T3ID", "T11FK1D", "T2FK1D"),
      CONSTRAINT "TEST3_TEST1_FK1" FOREIGN KEY ("T11FK1D")
      REFERENCES TEST1 ("ID") ENABLE,
     CONSTRAINT "TEST3_TEST2_FK1" FOREIGN KEY ("T2FK1D")
      REFERENCES TEST2 ("T2ID") ENABLE
   ) ;






test1.hbm.xml
----------------
<?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">
<!--
    Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
    <class name="comjava.Test1" table="TEST1" schema="SYSTEM">
        <id name="id" type="java.math.BigDecimal">
            <column name="ID" precision="22" scale="0" />
            <generator class="assigned" />
        </id>
        <property name="desc" type="java.lang.String">
            <column name="DESC" length="20" />
        </property>
        <set name="test3s" inverse="true">
            <key>
                <column name="T11FK1D" precision="22" scale="0" not-null="true" />
            </key>
            <one-to-many class="comjava.Test3" />
        </set>
        <one-to-one name="test2" class="comjava.Test2"></one-to-one>
    </class>
</hibernate-mapping>


test2.hbm.xml
--------------

<?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">
<!--
    Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
    <class name="comjava.Test2" table="TEST2" schema="SYSTEM">
        <id name="t2id" type="java.math.BigDecimal">
            <column name="T2ID" precision="22" scale="0" />
            <generator class="assigned" />
        </id>
      
        <one-to-one name="test1" class="comjava.Test1" constrained="true"></one-to-one>
      
        <property name="t1fkid" type="java.math.BigDecimal">
            <column name="T1FKID" precision="22" scale="0" not-null="true" />
        </property>
      
        <property name="t2desc" type="java.lang.String">
            <column name="T2DESC" length="20" />
        </property>
      
        <set name="test3s" inverse="true">
            <key>
                <column name="T2FK1D" precision="22" scale="0" not-null="true" />
            </key>
            <one-to-many class="comjava.Test3" />
        </set>
      
      
      
    </class>
</hibernate-mapping>


test3.hbm.xml
-------------

<?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">
<!--
    Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
    <class name="comjava.Test3" table="TEST3" schema="SYSTEM">
        <composite-id name="id" class="comjava.Test3Id">
            <key-property name="t3id" type="java.math.BigDecimal">
                <column name="T3ID" precision="22" scale="0" />
            </key-property>
            <key-property name="t11fk1d" type="java.math.BigDecimal">
                <column name="T11FK1D" precision="22" scale="0" />
            </key-property>
            <key-property name="t2fk1d" type="java.math.BigDecimal">
                <column name="T2FK1D" precision="22" scale="0" />
            </key-property>
        </composite-id>
      
      
        <many-to-one name="test1" class="comjava.Test1" update="false" insert="false" fetch="select">
            <column name="T11FK1D" precision="22" scale="0" not-null="true" />
        </many-to-one>
      
        <many-to-one name="test2" class="comjava.Test2" update="false" insert="false" fetch="select">
            <column name="T2FK1D" precision="22" scale="0" not-null="true" />
        </many-to-one>
        <property name="t3desc" type="java.lang.String">
            <column name="T3DESC" length="20" />
        </property>
    </class>
</hibernate-mapping>


java classes
--------------

test1.java
-----------
package comjava;

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;


/**
 * Test1 entity. @author MyEclipse Persistence Tools
 */

public class Test1  implements java.io.Serializable {


    // Fields  

     private BigDecimal id;
     private String desc;
     private Set test3s = new HashSet(0);
     private Test2 test2;


    // Constructors

    /** default constructor */
    public Test1() {
    }

    /** minimal constructor */
    public Test1(BigDecimal id) {
        this.id = id;
    }
  
    /** full constructor */
    public Test1(BigDecimal id, String desc, Set test3s, Test2 test2) {
        this.id = id;
        this.desc = desc;
        this.test3s = test3s;
        this.test2 = test2;
    }

 
    // Property accessors

    public BigDecimal getId() {
        return this.id;
    }
  
    public void setId(BigDecimal id) {
        this.id = id;
    }

    public String getDesc() {
        return this.desc;
    }
  
    public void setDesc(String desc) {
        this.desc = desc;
    }

    public Set getTest3s() {
        return this.test3s;
    }
  
    public void setTest3s(Set test3s) {
        this.test3s = test3s;
    }

    public Test2 getTest2() {
        return this.test2;
    }
  
    public void setTest2(Test2 test2) {
        this.test2 = test2;
    }

}


test2.java
-----------
package comjava;

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;


/**
 * Test2 entity. @author MyEclipse Persistence Tools
 */

public class Test2  implements java.io.Serializable {


    // Fields  

     private BigDecimal t2id;
     private Test1 test1;
     private BigDecimal t1fkid;
     private String t2desc;
     private Set test3s = new HashSet(0);


    // Constructors

    /** default constructor */
    public Test2() {
    }

    /** minimal constructor */
    public Test2(BigDecimal t2id, Test1 test1, BigDecimal t1fkid) {
        this.t2id = t2id;
        this.test1 = test1;
        this.t1fkid = t1fkid;
    }
  
    /** full constructor */
    public Test2(BigDecimal t2id, Test1 test1, BigDecimal t1fkid, String t2desc, Set test3s) {
        this.t2id = t2id;
        this.test1 = test1;
        this.t1fkid = t1fkid;
        this.t2desc = t2desc;
        this.test3s = test3s;
    }

 
    // Property accessors

    public BigDecimal getT2id() {
        return this.t2id;
    }
  
    public void setT2id(BigDecimal t2id) {
        this.t2id = t2id;
    }

    public Test1 getTest1() {
        return this.test1;
    }
  
    public void setTest1(Test1 test1) {
        this.test1 = test1;
    }

    public BigDecimal getT1fkid() {
        return this.t1fkid;
    }
  
    public void setT1fkid(BigDecimal t1fkid) {
        this.t1fkid = t1fkid;
    }

    public String getT2desc() {
        return this.t2desc;
    }
  
    public void setT2desc(String t2desc) {
        this.t2desc = t2desc;
    }

    public Set getTest3s() {
        return this.test3s;
    }
  
    public void setTest3s(Set test3s) {
        this.test3s = test3s;
    }

}


test3.java
----------

package comjava;



/**
 * Test3 entity. @author MyEclipse Persistence Tools
 */

public class Test3  implements java.io.Serializable {


    // Fields  

     private Test3Id id;
     private Test1 test1;
     private Test2 test2;
     private String t3desc;


    // Constructors

    /** default constructor */
    public Test3() {
    }

    /** minimal constructor */
    public Test3(Test3Id id, Test1 test1, Test2 test2) {
        this.id = id;
        this.test1 = test1;
        this.test2 = test2;
    }
  
    /** full constructor */
    public Test3(Test3Id id, Test1 test1, Test2 test2, String t3desc) {
        this.id = id;
        this.test1 = test1;
        this.test2 = test2;
        this.t3desc = t3desc;
    }

 
    // Property accessors

    public Test3Id getId() {
        return this.id;
    }
  
    public void setId(Test3Id id) {
        this.id = id;
    }

    public Test1 getTest1() {
        return this.test1;
    }
  
    public void setTest1(Test1 test1) {
        this.test1 = test1;
    }

    public Test2 getTest2() {
        return this.test2;
    }
  
    public void setTest2(Test2 test2) {
        this.test2 = test2;
    }

    public String getT3desc() {
        return this.t3desc;
    }
  
    public void setT3desc(String t3desc) {
        this.t3desc = t3desc;
    }

}

test3Id.java
--------------
package comjava;

import java.math.BigDecimal;


/**
 * Test3Id entity. @author MyEclipse Persistence Tools
 */

public class Test3Id  implements java.io.Serializable {


    // Fields  

     private BigDecimal t3id;
     private BigDecimal t11fk1d;
     private BigDecimal t2fk1d;


    // Constructors

    /** default constructor */
    public Test3Id() {
    }

  
    /** full constructor */
    public Test3Id(BigDecimal t3id, BigDecimal t11fk1d, BigDecimal t2fk1d) {
        this.t3id = t3id;
        this.t11fk1d = t11fk1d;
        this.t2fk1d = t2fk1d;
    }

 
    // Property accessors

    public BigDecimal getT3id() {
        return this.t3id;
    }
  
    public void setT3id(BigDecimal t3id) {
        this.t3id = t3id;
    }

    public BigDecimal getT11fk1d() {
        return this.t11fk1d;
    }
  
    public void setT11fk1d(BigDecimal t11fk1d) {
        this.t11fk1d = t11fk1d;
    }

    public BigDecimal getT2fk1d() {
        return this.t2fk1d;
    }
  
    public void setT2fk1d(BigDecimal t2fk1d) {
        this.t2fk1d = t2fk1d;
    }
 }


if u want to integrate spring with the ibernate project

the spring configuration will look like this

springConfig.xml
----------------

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">


    <bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="configLocation" value="file:src/hibernate.cfg.xml">
        </property>
    </bean>
</beans>

web service client

public static void main(String args){
String url="http;//localhost:9080/offer/axis/personWS?wsdl";
Service service=new service();
try{
Call cal=(Call) service.createCall();
call.setTargetEndPointAddress(url);

QName qn=new QName(url,"addPerson");
call.setOperationName(qn);
call.registerTypemapping(person.class,qn,
new BeanSerializerFactory(test.class,qn),
new BeanDeserializerFactory(test.class,qn));

// creation a person object

test vo=new test();

vo.setFirstName("FirstName");
vo.setMiddleName("Middlename");

call.invoke();




}catch(ServiceException e){
e.printStracktrace();
}catch(RemoteException e){
e.printStracktrace();
}


}

Ahead of his time, Tagore left a legacy for world

Rabindranath Tagore (1861-1941), the first Asian author to have won the Nobel Prize in literature, still remains an inspiration around the world. A poet, playwright, performer, musician, essayist, philosopher, and one of the finest storytellers from India (eight novels, four novellas and numerous short stories), he also had over 2,000 paintings and doodles to his credit.
As he said in his first talk at Shanghai in 1924: 'I say that a poet's mission is to attract the voice which is yet inaudible in the air; to inspire faith in the dream which is unfulfilled; to bring the earliest tidings of the unborn flower to a sceptic world.'
That Tagore was able to give voice to the voiceless from among the colonised and subjugated nations is history now. But his legacy still lives on because, as Mahatma Gandhi had once said about him: 'In common with thousands of his countrymen I owe much to one who by his poetic genius and singular purity of life has raised India in the estimation of the world.'
It was not that he advocated a narrow definition of 'nationalism' to equate it with 'nationism', but he wanted to keep the idea of Asia and a spirit of universalism that emerged from this continent alive and foregrounded this idea.
For Tagore, the immense beauty that a localised vernacular language had to offer in the form of the best of poetry and writings that he churned out throughout his life, and the local knowledge bases that were created over centuries and millennia had very special positions.
The youngest of many children, Tagore was born into a Kolkata aristocrat family to Debendranath and Sarada Devi. He had de-schooled himself as a young child. Yet before him, nobody seemed to have thought about Complete Education as he did in the early 20th century.
In his model of teaching, the school would provide a learning opportunity where there is a communion between man and nature, between liberal and the performing arts. That education did not mean 'rote' learning, memorisation and reproduction is clear from his opening paragraphs of the book titled 'Visva -Bharati': 'The education that encourages repetition is not the education of the mind, because that can be taken care of even mechanically!'.
When Tagore started his school in Santinketan in 1901, he had wanted to include girls as well, but it did not prove practical until 1909, when a further blow to the traditional image of his Brahmacharyashram occurred with the admission of six girl students who were not put in separate classes but rather along with the boys in classes, sports and elsewhere -- a radical idea then.
He faced the death of his closest relatives one after the other but these could not deter him from creating the finest writings, music, theatre, and paintings for his legacy.
Tagore's literary contributions created a large following among Bengali and foreign readers by the beginning of the 20th century, and he published by then such works as 'Naivedya' (1901) and 'Kheya' (1906) - culminating with 'Gitanjali: Song Offerings' in 1912 that helped him win the Nobel Prize a year later. Talking about the charm of 'Gitanjali', W.B. Yeats wrote: 'These prose translations have stirred my blood as nothing has for years.'
Tagore was a widely travelled man and had himself said about his fascination for travel. 'I am a wayfarer of the endless road' - starting with his first trip to the Himalayas in 1873 with his father, and then on to numerous countries all around the world. The journey to Kolkata from Santiniketan in 1941 came immediately after his stirring address titled 'Crisis in Civilization' where Tagore observed the darkening clouds of war and destruction gather over the world.
Bengali theatre of the 19th century, which emerged as a product of Bengal Renaissance, was a colonial phenomenon and largely urban in nature, but it was completely revolutionised by Tagore through his numerous plays as well as dance-dramas. English theatre in those days mainly catered to the local British residents.
Tagore had created a new universe of theatre by bringing in a rare combination of traditional musical theatre ('Jatra'), didactic story-telling tradition ('kathakata'), singing of bards ('Kabigan') and folk-epic narratives ('panchali').
In that sense, with him, modern theatre was born in India, without aping the Western stage.
In addition, he created a truly large and varied body of music (over 2,230 songs) in 64 years between 1877 and 1941, where he brought in a rare fusion between the folk and the Indian classical, the traditional devotional songs with the western choir and church music, thus bringing in a rare convergence between the north Indian Hindustani tradition and the southern Karnataki tradition.
Tagore's legacy is not a simple case of a poet being remembered for some memorable lines. He was a model of a person who had all the wisdoms of the past, and yet was a modernist to the core - making a beginning in several endeavours that he had undertaken in each field he traversed. Even when he experimented with religious thinking and practices, his mission was 'divinisation of man and the humanising of god'.
This was the reason he adopted a lot of wisdom from ancient Hindu thoughts as well as from Buddhism and Christianity. His reading and commentaries on all religious texts and thoughts have given rise to many important philosophical and ethical questions.
Said Martin Kampchen, a German specialist of Tagore: 'Creative writers like Tagore do not merely produce works of art, but they also create a new art of living which translates, as closely as possible, the essence of their creative impulses into a social context.'
(08.05.2010 - Udaya Narayana singh is a linguist by profession, and is currently the Director & Tagore Research Chair, Rabindra Bhavana, Visva Bharati, Santiniketan, and is himself an accomplished poet, playwright and essayist. He can be contacted at unsciil@yahoo.com)

15 secrets you never knew about your girl

Couple
15 secrets you never knew about your girl (Getty Images)
The woman in your life may give you her heart, soul and, of course, her body, but still there’s a part of her being that she’ll never share with you ... stuff that makes her a mystery .

Yes, your woman is a den of mysteries hinted to you in her sly smile, enigmatic laughter or that sudden silence. She just pretends to be one, but is never an open book to you. Her deepest secrets are what add to her charm ... but render you an outsider in her own ‘Secret Garden’. Secrets of her unshared yearnings, cherished fantasies or for that matter, a secret lover from the past ...

Here’s a peep into those hidden secrets ... dig into them at your own risk!

- I might just hate it when you sleep in that office shirt, but when you are away, I love to snuggle up in your shirt because it smells of you.

- Though I insist on paying the bill or sharing it in our initial dates, I’ll find you cheap and so non-chivalrous in case you don’t insist on making the payment.

- Long before we explored each other’s bodies, I had been fantasizing about being with you. That inhibition was only to get assured that you are all mine.

- I do think about my ex-es and compare them to you. Mostly you win, but you are not all perfect.

- ‘I don’t care you call or not’ is pure pretence. In fact, I start waiting for your next call the moment one ends. Not just this, I eagerly want you to plan our next date even before the current one ends. I might not show it. So, don’t fret about looking desperate just call! The gap looks like a lifetime to me.

- During the initial days of our relationship, I used to save all our chat histories and your SMSes and read them again and again. Sometimes, made my friends read them, too.

- The day you shared your password with me, digging into your chat records and mails was the first thing I did.

- I would love to know what turns you on. Though, I know it’s going to be hilarious as I’ve seen your frequently-visited porn sites.

- You don’t have to be a ‘good boy’ with me all the time. I don’t mind talking a little dirty.

- You are my soul mate, but my ‘best friend’ is my confidante. From the size of your pay cheque, bank account to the size of your other assets...she knows it all. So, till you are telling her how much you love me all’s fine. Remember she’s my best friend and never yours.

- You rightly blame me for bombarding you with so many questions. But, that’s my way of testing you. I judge and analyse you on every word, expression, action, e-mail or SMS you write to me or someone else. So, when I ask “Do you fantasize about other women?,” the answer has to be “Why would I when I am with you?” So, better watch out!

- I love to make you a little jealous as it makes me feel wanted. So the next time you spot me flirting with your friend, know that I’m actually flirting with you through her.

- Every time I fight with you is because I feel ignored. Don’t get into your cocoon when I’m bad. Just give me what I’m fighting for – a little attention and I’ll be all yours.

- I love to get constant reminders of the much known fact that – you need me. So, what’s the harm in dropping liners saying ‘You complete me’ or ‘Don’t ever leave me alone’ ... ?

- Last but not the least, irrespective of how independent and self-driven I am, how ever much I may say that I don’t need a man to be happy, but still I want you to take charge when we are in bed.

Cricinfo International Scores

Cricinfo International Scores: "Get the latest scores of all the international cricket matches from Cricinfo. Add the Cricinfo International Scores widget now!"