Hi everybody, this was my surprise project , achivy.com 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…

[caption id=”” align=”alignright” width=”240" caption=”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

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;


JPA Criteria API by samples — Part-I

some more examples with JPA criteria API
Simple Join query

long category=200L;
Query query = entityManager.createQuery(“select s from OrderItem s where s.product.category=:cat”);
query.setParameter(“cat”, category);
List<OrderItem> list = query.getResultList();
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<Object> criteriaQuery = criteriaBuilder.createQuery();
Root<OrderItem> from = criteriaQuery.from(OrderItem.class);
Path<Object> path = from.join(“product”).get(“category”);
CriteriaQuery<Object> select = criteriaQuery.select(from);
select.where(criteriaBuilder.equal(path, category));
TypedQuery<Object> typedQuery =…

Here you can see how to traverse the runtime information to get this information. You Can simply traverse the inheritance tree ofr the class and get the metadata of the generic definition. Somthing like

public static Type[] getGenericDefinitons(Class classFrom, Class class1) ;
Type[] types=getGenericDefinitons(MockClass1.class,GenericInterface.class);//[String.class,Long.class,Integer.class] expected
First The Sample Cases :


#expat #amsterdam #cycling

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store