1 package mir.storage.store;
6 * Copyright: Copyright (c) 2002
12 public final class StoreUtil {
14 private final static Class storableObjectInterface=StorableObject.class;
17 private StoreUtil() { }
20 public static final String getPropNameFor(Class aClass) {
22 String className=aClass.toString();
23 return className.substring(className.lastIndexOf(".")+1);
28 public static final String getEntityListUniqueIdentifierFor( String table,
29 String where, String order, int offset, int limit)
31 StringBuffer sb = new StringBuffer(table);
33 if ( where!=null ) sb.append(where);
35 if ( order!=null ) sb.append(order);
36 sb.append("@").append(offset);
37 sb.append("@").append(limit);
42 * Method: implementsStorableObject
43 * Description: internall helper method to find out if a class implements
44 * interface StorableObject.
46 * @return true if yes, otherwise no.
48 public final static boolean implementsStorableObject(Class aClass) {
50 Class[] interfaces = aClass.getInterfaces();
51 if (interfaces.length>0) {
52 for (int i=0;i<interfaces.length;i++) {
53 if (interfaces[i]==storableObjectInterface) return true;