Examples of TableImpl


Examples of com.belladati.sdk.impl.TableViewImpl.TableImpl

    try {
      URIBuilder builder = new URIBuilder("api/reports/views/" + viewId + "/" + viewType.getUri());
      JsonNode json = service.loadJson(service
        .appendDateTime(service.appendFilter(builder, filters), dateInterval, timeInterval).build().toString());
      if (viewType == ViewType.TABLE) {
        return new TableImpl(service, viewId, json, filters);
      }
      return json;
    } catch (URISyntaxException e) {
      throw new InternalConfigurationException(e);
    }
View Full Code Here

Examples of com.belladati.sdk.impl.TableViewImpl.TableImpl

  public Object loadViewContent(String viewId, ViewType viewType, Collection<Filter<?>> filters) {
    try {
      URIBuilder builder = new URIBuilder("api/reports/views/" + viewId + "/" + viewType.getUri());
      JsonNode json = loadJson(appendFilter(builder, filters).build().toString());
      if (viewType == ViewType.TABLE) {
        return new TableImpl(this, viewId, json, filters);
      }
      return json;
    } catch (URISyntaxException e) {
      throw new InternalConfigurationException(e);
    }
View Full Code Here

Examples of com.belladati.sdk.impl.TableViewImpl.TableImpl

      URIBuilder builder = new URIBuilder("api/reports/views/" + viewId + "/" + viewType.getUri());
      JsonNode json = service.loadJson(service
        .appendLocale(service.appendDateTime(service.appendFilter(builder, filters), dateInterval, timeInterval), locale)
        .build().toString());
      if (viewType == ViewType.TABLE) {
        return new TableImpl(service, viewId, json, filters).setLocale(locale);
      }
      return json;
    } catch (URISyntaxException e) {
      throw new InternalConfigurationException(e);
    }
View Full Code Here

Examples of com.force.sdk.jpa.table.TableImpl

        registerTable(ForceOwner.class);
    }
   
    @SuppressWarnings("rawtypes")
    public void registerTable(Class<?> entityClass) {
        TableImpl tableImpl;
        CustomObject customObjectAnnotation = entityClass.getAnnotation(CustomObject.class);
        if (customObjectAnnotation != null && customObjectAnnotation.virtualSchema()) {
            tableImpl = MockPersistenceUtils.constructVirtualTableImpl(entityClass);
        } else {
            tableImpl = MockPersistenceUtils.constructTableImpl(entityClass);
View Full Code Here

Examples of com.force.sdk.jpa.table.TableImpl

    @Override
    public void locateObject(ObjectProvider op) {
        ForceManagedConnection mconn = (ForceManagedConnection) storeManager.getConnection(op.getExecutionContext());
        try {
            AbstractClassMetaData acmd = op.getClassMetaData();
            TableImpl table = storeManager.getTable(acmd);
            QueryResult qr = ((PartnerConnection) mconn.getConnection())
                .query("select count() from " + table.getTableName().getForceApiName() + " where id='"
                        + op.provideField(op.getClassMetaData().getPKMemberPositions()[0]) + "'");
            if (qr.getSize() == 0) {
                throw new NucleusObjectNotFoundException();
            }
        } catch (ConnectionException x) {
View Full Code Here

Examples of com.force.sdk.jpa.table.TableImpl

                             * This is instance of AllOrNothing transaction
                             * Since the parent object has not been saved to the db yet
                             * we do not have an id yet so we link objects by extId
                             */
                            SObject parentRef = new SObject();
                            TableImpl parent = storeManager.getTable(acmd);
                            if (parent.getExternalIdColumn() == null) {
                                throw new NucleusUserException("EntityManager in persistence.xml has 'force.AllOrNothing'"
                                                               + " set to true. In this mode all top parent Entities must"
                                                               + " have an externalId field. Offending entity: "
                                                               + parent.getTableName().getName());
                            }
                            parentRef.setType(parent.getTableName().getForceApiName());
                            SObject parentSObject = ((ForceObjectManagerImpl) om).getParentSObject(value);
                            parentRef.setField(parent.getExternalIdColumn().getFieldName(),
                                                parentSObject.getField(parent.getExternalIdColumn().getFieldName()));
                            actualValue = parentRef;
                            actualFieldName = column.getForceApiRelationshipName();
                        } else {
                            throw new NucleusUserException("Child entity cannot be saved before parent entity.");
                        }
View Full Code Here

Examples of com.force.sdk.jpa.table.TableImpl

        throw new NucleusUserException("DataNucleus doesnt currently support deletion of schemas for Force.com");
    }

    @Override
    public StoreSchemaData getSchemaData(Object conn, String objName, Object[] values) {
        final TableImpl table = getTable(objName);
        return table == null ? null : new StoreSchemaData() {
           
            @Override
            public Object getProperty(String name) {
                return table.getColumnByForceApiName(name);
            }
           
            @Override
            public void addProperty(String name, Object value) {
                throw new NucleusUserException("DataNucleus doesnt currently support adding properties"
View Full Code Here

Examples of com.force.sdk.jpa.table.TableImpl

     */
    public TableImpl addTable(AbstractClassMetaData acmd, ForceManagedConnection conn) {
        String entityName = PersistenceUtils.getEntityName(acmd).toLowerCase();
        try {
            TableName tableName = TableName.createTableName(conn.getNamespace(), acmd);
            TableImpl tableImpl = tables.get(tableName.getForceApiName().toLowerCase());
            if (tableImpl == null) {
                tableImpl = new TableImpl(conn.getNamespace(), tableName, sObjectResults.get(tableName.getForceApiName()), conn);
                tables.put(tableName.getForceApiName().toLowerCase(), tableImpl);
            }
            entityTables.put(entityName, tableImpl);
            return tableImpl;
        } catch (ConnectionException e) {
View Full Code Here

Examples of com.force.sdk.jpa.table.TableImpl

     * @return the created TableImpl
     */
    public TableImpl addVirtualTable(AbstractClassMetaData acmd) {
        String entityName = PersistenceUtils.getEntityName(acmd).toLowerCase();
        TableName tableName = TableName.createTableName("", acmd);
        TableImpl tableImpl = tables.get(tableName.getForceApiName().toLowerCase());
        if (tableImpl == null) {
            tableImpl = new TableImpl(tableName, acmd);
            tables.put(tableName.getForceApiName().toLowerCase(), tableImpl);
        }
        entityTables.put(entityName, tableImpl);
        return tableImpl;
    }
View Full Code Here

Examples of com.force.sdk.jpa.table.TableImpl

        new ClassInitializer() {
            @Override
            void init(AbstractClassMetaData cmd, ForceStoreManager storeManager, ForceManagedConnection mconn)
                throws ConnectionException {
               
                TableImpl table = storeManager.getTable(cmd);
                table.getMetaData(cmd).emit(storeManager, mconn);
            }
        } .initialize(fileMD, storeManager);
       
        // now do the writing
        try {
            storeManager.getSchemaWriter().write(storeManager.createConnection());
        } catch (Exception e) {
            if (e instanceof RuntimeException) {
                throw (RuntimeException) e;
            } else {
                throw new NucleusException(e.getMessage(), e);
            }
        }
       
        // Reload new metadata
        new ClassInitializer() {
            @Override
            void init(AbstractClassMetaData cmd, ForceStoreManager storeManager, ForceManagedConnection mconn)
                throws ConnectionException {
               
                TableImpl table = storeManager.getTable(cmd);
                if (!table.isValid()) {
                    table.refresh(null, mconn);
                }
            }
        } .initialize(fileMD, storeManager);
       
        for (FileMetaData md : fileMD) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.