1 package com.quantum.model;
9 public class EntityFactory {
11 private static EntityFactory instance = new EntityFactory();
13 private EntityFactory() {
16 public static EntityFactory getInstance() {
17 return EntityFactory.instance;
20 public Entity create(Bookmark bookmark, String schema, String name, String type) {
22 type = type.toUpperCase().trim();
25 if (Entity.TABLE_TYPE.equals(type)) {
26 return new TableImpl(bookmark, schema, name);
27 } else if (Entity.VIEW_TYPE.equals(type)) {
28 return new ViewImpl(bookmark, schema, name);
29 } else if (Entity.SEQUENCE_TYPE.equals(type)) {
30 return new SequenceImpl(bookmark, schema, name);
33 // throw new IllegalArgumentException("Unknown type: " + type);