How to Install PostgreSQL 9.2 on Ubuntu 12

install Postgresql 9.2 on ubuntu server

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.2

hopefully will move from mysql to postgresql

I will try to publish some performance comparision !!!




just launched…

Hi everybody, this was my surprise project , my first startup, my first ruby on rails project :)

you can check the  about page  but it is simply a gamification platform for lots of social sites and more, it now supports foursquare, gowalla, stackoverflow etc….

Achivy adds some fun and gamification to your social life. Add Twitter,Tumblr, Foursquare Gowalla , Flickr, Stackoverflow, Klout and many other applications to your profile to see how many achievements, badges,scores you have and follow your progress. You can keep up with your friends, and see the other people’s achievements and activities – achivies.

more to come soon…

todo list


Image by alancleaver_2000 via Flickr

it has been a long time since I posted  :( so it would  be really good to put some targets and build a list of them. otherwise I will be lying on my coach all the time.

  • ruby on rails experience : so far so amazing.
  • yagdao :  finalize and release 1.0
  • startupweekend amsterdam notes ! anybody for utrecht ?
  •  ???, surprise
hope to implement all those and do something interesting here
see you soon

Release Notes: com.altuure.yagdao-0.3.jar

Append Method handler

Another dynamic query builder. But this one , use simple StringBuilder instead of trying to parse the argument.  So more fast and adjustable dynamic query builder

For more see test cases and example dao

   @YMethod(type = YMethodType.APPEND,select = "pbyte,count(id)",groupBy = "pbyte")
    List<SimpleBean> append2(@YParameter("pint>=?") int i);

    @YMethod(type = YMethodType.APPEND,select = "pbyte,count(id)",groupBy = "pbyte",having = "count(id)>10")
    List<SimpleBean> append3(@YParameter("pint>=?") int i);

group and having support with aggregation support

Append and JPA criteria methods now support Projections

Execute Method handler

bulk method support

   @YMethod(type = YMethodType.EXECUTE,query = "update SimpleBean set pint=:newInt where id=:id ")
    int execute1(@YParameter(value = "newInt") int newInt,@YParameter(value = "id") long id);

experimental criteria query parser for JPA

Criteria method is now support more sophisticated queries . please see test cases and example dao

    @YMethod(type = YMethodType.CRITERIA)
    SearchResultList<SimpleBean> criteria2(@YParameter("pint >=") Integer arg1,@YParameter("pint <=") Integer arg2);

    @YMethod(type = YMethodType.CRITERIA)
    SearchResultList<SimpleBean> criteria3(@YParameter("pstring is null") boolean apply);

    @YMethod(type = YMethodType.CRITERIA)
    SearchResultList<Object> criteria2CheckApplied(@YParameter("pint>=20000") boolean apply1,@YParameter( "pint<=50000") boolean apply2);


I published for version of the yagdao (Yet Another Generic DAO) finally.

this version is a little bit experimental but stable.

yagdao is an generic dao framework  that would be enabled by annotations.

simple step to go through for setup read more

  • add jar into your classpath
  • extend GenericDAO

moreover you can implement custom method read more

Retrieving Id field from JPA and Hibernate

quick code snippet to get the identifier field name for a given entity class from both hibernate and JPA 2.0 APIs.

for hibernate

public String getIdProperty(Class entityClass) {
String idProperty=sessionAccessor.getSessionFactory()
return idProperty;

for JPA 2.0 metamodel API this method or to get value of id field see comment below

public String getIdProperty(Class entityClass) {
        String idProperty;
        Metamodel metamodel = getEntityManager().getMetamodel();
        EntityType entity = metamodel.entity(entityClass);
        Set<SingularAttribute> singularAttributes = entity.getSingularAttributes();
        for (SingularAttribute singularAttribute : singularAttributes) {
            if (singularAttribute.isId()){
            throw new RuntimeException("id field not found");
        return idProperty;