Exemplo n.º 1
0
 /* (non-Javadoc)
  * @see uk.ac.ucl.excites.sapelli.collector.db.ProjectStore#storeHeldForeignKey(uk.ac.ucl.excites.sapelli.collector.model.fields.Relationship, uk.ac.ucl.excites.sapelli.storage.model.RecordReference)
  */
 @Override
 public void storeHeldForeignKey(Relationship relationship, RecordReference foreignKey) {
   try {
     rsWrapper.recordStore.store(getHFKRecord(relationship, foreignKey));
   } catch (DBException e) {
     e.printStackTrace();
   }
 }
Exemplo n.º 2
0
 /* (non-Javadoc)
  * @see uk.ac.ucl.excites.sapelli.collector.db.ProjectStore#deleteHeldForeignKey(uk.ac.ucl.excites.sapelli.collector.model.fields.Relationship)
  */
 @Override
 public void deleteHeldForeignKey(Relationship relationship) {
   try {
     rsWrapper.recordStore.delete(getHFKRecordReference(relationship));
   } catch (DBException e) {
     e.printStackTrace();
   }
 }
Exemplo n.º 3
0
 /* (non-Javadoc)
  * @see uk.ac.ucl.excites.sapelli.collector.db.ProjectStore#doAdd(uk.ac.ucl.excites.sapelli.collector.model.Project)
  */
 @Override
 protected void doAdd(Project project)
     throws ProjectIdentificationClashException, ProjectSignatureClashException,
         IllegalStateException {
   try { // Note: we use insert() instead of store() to not allow updates
     // Store project record:
     rsWrapper.recordStore.insert(getProjectRecord(project));
     // Store an FSI record for each record-producing form:
     for (Form form : project.getForms())
       if (form.isProducesRecords()) rsWrapper.recordStore.insert(getFSIRecord(form));
     // Cache the project:
     cacheProject(project);
   } catch (DBPrimaryKeyException dbPKE) {
     throw new ProjectIdentificationClashException(project, false);
   } catch (DBConstraintException dbCE) {
     throw new ProjectSignatureClashException(project);
   } catch (DBException e) {
     e.printStackTrace(System.err);
     throw new IllegalStateException(e);
   }
 }