@@ -0,0 +1,597 @@
+@SuppressWarnings(%7B%22unchecked%22, %22rawtypes%22%7D)%0Aprivate String getIdProperty(Class%3C?%3E entityClass) %7B%0A%09String idProperty = null;%0A%09Metamodel metamodel = this.emf.getMetamodel();%0A%09EntityType entity = metamodel.entity( entityClass );%0A%09Set%3CSingularAttribute%3E singularAttributes = entity.getSingularAttributes();%0A%09for ( SingularAttribute singularAttribute : singularAttributes ) %7B%0A%09%09if ( singularAttribute.isId() ) %7B%0A%09%09%09idProperty = singularAttribute.getName();%0A%09%09%09break;%0A%09%09%7D%0A%09%7D%0A%09if ( idProperty == null ) %7B%0A%09%09throw new SearchException( %22id field not found for: %22 + entityClass );%0A%09%7D%0A%09return idProperty;%0A%7D%0A

Create snip.java