Random notes on Hibernate:
Some important objects of Hibernate:
1) SessionFactory: Threadsafe/immutable cache of compiled mappings to a single database. For each database there is one SessionFactory object. It's a factory of sessions and client of ConnectionProvider. Holds optional secondary-level cache of objects.
2) Session: Single threaded, short lived object. Factory of Transactions. Wraps up JDBC Connection. Holds mandatory first-level cache of objects.
3) Transaction: Single threaded, short lived object. Represents atomic units of work. A session might span multiple Transactions.
State of Instance objects:
1) Persistent: Object is associated with a persistent context. It has a persistence identity(primary key). Hibernate guarantees that the persistent identity is equivalent to the java identity.
2) Detached: Object was once associated with persistence context, however the context is closed. Hibernate makes no guarantee about the relationship between the persistent context and java context.
3) Transient: Object is not and never has been associated with persistence context. Has no persistent identity(primary key value).
Thursday, March 5, 2009
Thursday, February 19, 2009
Subtracting DateTime values in PS Query
In PS Query, DateTime (e.g. BEGINDTTM) field is changed to the TO_CHAR(A.BEGINDTTM,'YYYY-MM-DD-HH24.MI.SS."000000"') .
To subtract a DateTime field from another Datetime field, following expression should be created:
TO_DATE(SUBSTR(A.ENDDTTM,1,16),'YYYY-MM-DD-HH24.MI') - TO_DATE(SUBSTR(A.BEGINDTTM,1,16),'YYYY-MM-DD-HH24.MI')
The sql of the query would be:
SELECT TO_CHAR(A.BEGINDTTM,'YYYY-MM-DD-HH24.MI.SS."000000"'), TO_CHAR(A.ENDDTTM,'YYYY-MM-DD-HH24.MI.SS."000000"'), TO_DATE(SUBSTR( TO_CHAR(A.ENDDTTM,'YYYY-MM-DD-HH24.MI.SS."000000"'),1,16),'YYYY-MM-DD-HH24.MI') - TO_DATE(SUBSTR( TO_CHAR(A.BEGINDTTM,'YYYY-MM-DD-HH24.MI.SS."000000"'),1,16),'YYYY-MM-DD-HH24.MI')
FROM PS_PMN_PRCSLIST A
Hope this is helpful.
Cheers.
To subtract a DateTime field from another Datetime field, following expression should be created:
TO_DATE(SUBSTR(A.ENDDTTM,1,16),'YYYY-MM-DD-HH24.MI') - TO_DATE(SUBSTR(A.BEGINDTTM,1,16),'YYYY-MM-DD-HH24.MI')
The sql of the query would be:
SELECT TO_CHAR(A.BEGINDTTM,'YYYY-MM-DD-HH24.MI.SS."000000"'), TO_CHAR(A.ENDDTTM,'YYYY-MM-DD-HH24.MI.SS."000000"'), TO_DATE(SUBSTR( TO_CHAR(A.ENDDTTM,'YYYY-MM-DD-HH24.MI.SS."000000"'),1,16),'YYYY-MM-DD-HH24.MI') - TO_DATE(SUBSTR( TO_CHAR(A.BEGINDTTM,'YYYY-MM-DD-HH24.MI.SS."000000"'),1,16),'YYYY-MM-DD-HH24.MI')
FROM PS_PMN_PRCSLIST A
Hope this is helpful.
Cheers.
Friday, January 23, 2009
Curse of Intelligence
The Curse of intelligent and just is that he has to act just fully towards whom he loves.
Monday, November 10, 2008
PeopleSoft: Adding records to Query Tree
PeopleSoft:
Problem:
Just the other day, a business analyst was not able to view a particular record (PSSQLTEXTDEFN) in the "Query Manager" in PIA, while creating a new query.
Solution:
Implementing Query Security.
Open a Query tree definition:
Problem:
Just the other day, a business analyst was not able to view a particular record (PSSQLTEXTDEFN) in the "Query Manager" in PIA, while creating a new query.
Solution:
Implementing Query Security.
Open a Query tree definition:
- Select PeopleTools, Security, Query Security, Query Access Manager.
-
On the Basic Search page select your search criteria.
You can search by Tree Name, Tree Category, or Tree Description.
-
Click Search.
After clicking Search, a list appears containing the definitions that meet your criteria.
- Select an appropriate tree and add the record definition in the "Record Definition" node and save the changes.
- Select PeopleTools, Security, Query Security, Query Access List Cache.
- Click Run button and execute the process to Success. This would resolve the problem and you would be able to view the Record in Query Manager.
Sunday, June 1, 2008
War and Men
I just saw "Band of Brothers". It's a wonderful re-enactment of World War II. The direction is excellent. It relives the horrors of the war and seeing it I wondered, How come we, human beings (and the only rational animal), forget what our greed leads us to do? How can mankind still fight wars after experiencing that monstrosity?
I guess it's just that we forget too soon or we are a step shorter of nature's perfection that is yet to happen?
I guess it's just that we forget too soon or we are a step shorter of nature's perfection that is yet to happen?
Saturday, January 12, 2008
Random Thoughts
This posts aren't really for anyone to read. If anyone reads, well it doesn't matter.
So the thought is what is the thing that I really crave for? I believe every man has something which would engross him to the extent that the rest of the world becomes immaterial. Take any case in history, literature and you would agree with me. But the sad part is most of the men are either ignorant about this or spend their entire lifetime searching for it. Maybe I fall into the second category, and that is my worst fear. Those who really find, either are terrific success or terrible failure. I would prefer to be either of that, than being a mediocre. Mediocrity is a disaster, a waste of life.
I was initially interested in software development. I guess opium/cocaine would have the same effect on me as software development. It's just wonderful to feel that, as the complexity increases, so does the effect, where the whole body and mind blend into one, and the only sole thing that would exist is the solution to the problem on hand and nothing else. But then life doesn't seem to take proper turns, as intended, after every run there is a phase when everything is at standstill. It's so obscene in effect.
That's the phase which I hate most than anything else living or dead. Sometimes I feel that I took a wrong decision in selecting the technology, Peoplesoft. I always have a break/vacation, which I desperately don't want.
[to be contd. got work to finish...]
So the thought is what is the thing that I really crave for? I believe every man has something which would engross him to the extent that the rest of the world becomes immaterial. Take any case in history, literature and you would agree with me. But the sad part is most of the men are either ignorant about this or spend their entire lifetime searching for it. Maybe I fall into the second category, and that is my worst fear. Those who really find, either are terrific success or terrible failure. I would prefer to be either of that, than being a mediocre. Mediocrity is a disaster, a waste of life.
I was initially interested in software development. I guess opium/cocaine would have the same effect on me as software development. It's just wonderful to feel that, as the complexity increases, so does the effect, where the whole body and mind blend into one, and the only sole thing that would exist is the solution to the problem on hand and nothing else. But then life doesn't seem to take proper turns, as intended, after every run there is a phase when everything is at standstill. It's so obscene in effect.
That's the phase which I hate most than anything else living or dead. Sometimes I feel that I took a wrong decision in selecting the technology, Peoplesoft. I always have a break/vacation, which I desperately don't want.
[to be contd. got work to finish...]
Thursday, September 27, 2007
Anarchy is our dharma - Jug Suraiya
Anarchy is our dharma
Jug Suraiya | TNN
It’s often said that India is a functioning anarchy. That seeming contradiction in terms is, in fact, not a contradiction at all. On the contrary, it is a confirmation of the truth about India and Indians: India, we, can only function because we’re anarchic.
The dictionary defines anarchy as a state of disorder without government or control, a condition where no hard and fast rules apply. This is certainly true of India, at almost all levels. Wherever you look, there is not the slightest vestige of what more ordered societies call discipline, an adherence to regulations, norms and codes of behaviour.
Indians, all Indians, literally do their own thing. Take traffic. India’s road traffic (where there is the luxury of a road) is among the most chaotic in the world. It has to be in order to function. At any given time, a typical urban thoroughfare can simultaneously have on it some 17 very different types of transportation, from buses to bullock-carts, limousines to elephants. If all these various modes of transport, moving at different velocities and in different directions, were to follow some abstract, codified rules of the road instead of their own basic instincts, no one would ever get anywhere.
Out of apparent chaos emerges progress: in the end, they all—BMWs and bullock-carts, elephants and autorickshaws—get to their respective destinations with, generally speaking, the minimum of mishap, considering the sheer volume and diversity of the numbers involved.
Democracy and the art of negotiating traffic find a perfect parallel in India. Both involve extempore adjustments in order to traverse a common space (be it a road or the larger community of the nation) where often conflicting interests—BMWs-bullocks, SEZs-farmers—must negotiate with each other without colliding head-on. One step forward and three steps sideways? Perhaps. But it’s better than terminal gridlock. Or fatal collision.
Our identities as Indians are similarly ad hoc: we are a little bit of this, and a little bit of that. A little bit Punjabi, or Bengali, or Tamil, and a little bit Indian; a little bit Brahmin, or OBC, or Dalit, and a little bit ‘caste no bar’; a little bit capitalist, and a little bit socialist; a little bit religious and a little bit secular. We are all these things, and more.
What we are not is sliced white bread. Or uniformed fascists on parade (though there are some who want to make us exactly that, but our innate gift for anarchy has so far foiled them, thank God). We are not regimented; we are not disciplined.
Other societies go by the inflexible exactitude of rules. We, all of us, write our own rule books as we go along. As TOI columnist Santosh Desai has said, we function by that uniquely Indian concept called ‘andaz’, approximation. Other cooks use exact recipes; we use inexact, and creative, andaz. A pinch of this, and a dash of that. How much precisely? Arre, use your andaz, bhai. Other musicians use written score sheets; our music is based on constant improvisation on basic ragas, on andaz and all that jazz.
So are we forever doomed (or redeemed, take your pick) to be a thoroughly undisciplined lot? Certainly not. We do follow discipline; you follow your discipline, and let me follow mine. Except we mightn’t call it discipline. We might prefer to call it dharma.
Subscribe to:
Posts (Atom)