--- /dev/null
+package com.quantum.model;
+
+
+/**
+ *
+ *
+ * @author BC
+ */
+public class EntityFactory {
+
+ private static EntityFactory instance = new EntityFactory();
+
+ private EntityFactory() {
+ }
+
+ public static EntityFactory getInstance() {
+ return EntityFactory.instance;
+ }
+
+ public Entity create(Bookmark bookmark, String schema, String name, String type) {
+ if (type != null) {
+ type = type.toUpperCase().trim();
+ }
+
+ if (Entity.TABLE_TYPE.equals(type)) {
+ return new TableImpl(bookmark, schema, name);
+ } else if (Entity.VIEW_TYPE.equals(type)) {
+ return new ViewImpl(bookmark, schema, name);
+ } else if (Entity.SEQUENCE_TYPE.equals(type)) {
+ return new SequenceImpl(bookmark, schema, name);
+ } else {
+ return null;
+// throw new IllegalArgumentException("Unknown type: " + type);
+ }
+ }
+}