SqlUtils { public static String transformEJBtoSQLFields(String ejbFragment, String nodePrefix, String formatPrefix) { return ejbFragment.replace("profileResourceNode.metaData.name", nodePrefix + ".u_name ") .replace("profileResourceNode.metaData.size", nodePrefix + ".file_size") .replace("profileResourceNode.metaData.extensionMismatch", nodePrefix + ".extension_mismatch") .replace("profileResourceNode.metaData.extension", nodePrefix + ".u_extension") .replace("profileResourceNode.identificationCount", nodePrefix + ".identification_count") .replace("profileResourceNode.metaData.lastModifiedDate", nodePrefix + ".last_modified_date") .replace("profileResourceNode.metaData.resourceType", nodePrefix + ".resource_type") .replace("profileResourceNode.metaData.identificationMethod", nodePrefix + ".identification_method") .replace("profileResourceNode.metaData.nodeStatus", nodePrefix + ".node_status") .replace("format.mimeType", formatPrefix + ".mime_type") .replace("format.name", formatPrefix + ".u_name") .replace("format.puid", formatPrefix + ".puid") .replace("extensionMismatch", "extension_mismatch"); } private  SqlUtils(); static Object transformParameterToSQLValue(Object value); static String transformEJBtoSQLFields(String ejbFragment,
            String nodePrefix, String formatPrefix); static QueryBuilder getQueryBuilder(Filter filter); static Format buildFormat(final ResultSet results); static ProfileResourceNode buildProfileResourceNode(final ResultSet nodeResults); static int getNumberOfColumns(final ResultSet resultSet); static Integer getNullableInteger(final int position,
                                                  final ResultSet results); static Integer getNullableInteger(final String column,
                                             final ResultSet results); static String getNullableString(final int position,
                                           final ResultSet results); static String getNullableString(final String column,
                                           final ResultSet results); static Long getNullableLong(final int position,
                                         final ResultSet results); static Long getNullableLong(final String column,
                                       final ResultSet results); static Date getNullableTimestamp(final int position,
                                            final ResultSet results); static Date getNullableTimestamp(final String column,
                                            final ResultSet results); static void addIdentifications(final ProfileResourceNode node,
                                          final ResultSet identifications,
                                          final Map<String, Format> puidFormatMap); static void setNullableString(final int position, final String value, final PreparedStatement statement); static void setNullableInteger(final int position, final Integer value, final PreparedStatement statement); static void setNullableLong(final int position, final Long value, final PreparedStatement statement); static void setNullableTimestamp(final int position, final Date value, final PreparedStatement statement); static void setNullableEnumAsInt(final int position, final Enum value, final PreparedStatement statement); static void setNonNullableParameter(int position, Object parameter, PreparedStatement statement);  }
@Test public void transformEJBtoSQLFields() throws Exception { String res = SqlUtils.transformEJBtoSQLFields("profileResourceNode.metaData.extensionMismatch = ?", "children", "child_form"); String expected = "children.extension_mismatch = ?"; assertEquals(expected, res); }