コード例 #1
0
  public static void delete(Long id) {
    Institution institution = find.ref(id);
    if (institution == null) {
      return;
    }

    institution.retired = true;
    institution.save();
  }
コード例 #2
0
ファイル: Scenario.java プロジェクト: pmichna/citygame
 public static Scenario edit(
     Long scenarioId,
     String newName,
     Boolean newIsPublic,
     Date newExpirationDate,
     Boolean isAccepted) {
   Scenario scenario = find.ref(scenarioId);
   if (newName != null && !newName.equals(scenario.name)) {
     scenario.name = newName;
   }
   if (newIsPublic != null && newIsPublic != scenario.isPublic) {
     scenario.isPublic = newIsPublic;
   }
   if (newExpirationDate != null && !newExpirationDate.equals(scenario.expirationDate)) {
     scenario.expirationDate = newExpirationDate;
   }
   scenario.isAccepted = isAccepted;
   scenario.editedBy = null;
   scenario.save();
   return scenario;
 }
コード例 #3
0
 public static void edit(
     Long id, SchoolClass schoolClass, String date, String kindOfAssignment, String description) {
   Assignment assignment = find.ref(id);
   assignment.schoolClass = schoolClass;
   String[] array = parseDate(date);
   String dueDate = array[0];
   assignment.dueDate = dueDate;
   int year = Integer.parseInt(array[1]);
   assignment.year = year;
   int month = Integer.parseInt(array[2]);
   assignment.month = month;
   int day = Integer.parseInt(array[3]);
   assignment.day = day;
   assignment.spanner = kindOfAssignment.substring(0, 1);
   assignment.description = description;
   assignment.total = (year * 366) - ((12 - month) * 31) - (31 - day);
   try {
     assignment.save();
   } catch (PersistenceException e) {
     System.err.println("Unable to save an assignment after editing. ID: " + id);
   }
 }
コード例 #4
0
ファイル: Task.java プロジェクト: Aicha34/TaskManager
 public static void delete(Long id) {
   find.ref(id).delete();
 }
コード例 #5
0
 public static IdentityDocType get(Long id) {
   return find.ref(id);
 }
コード例 #6
0
ファイル: Layout.java プロジェクト: elhart/pdnetDisplay
 public static Layout get(Long id) {
   return find.ref(id);
 }
コード例 #7
0
ファイル: Layout.java プロジェクト: elhart/pdnetDisplay
 //	Deletes a display with a given id
 public static void delete(Long id) {
   find.ref(id).delete();
   // createXMLfile(Display.all());
 }
コード例 #8
0
ファイル: Doctor.java プロジェクト: ArtemVoronov/mis_nsu
 public static Doctor get(Long id) {
   return find.ref(id);
 }
コード例 #9
0
 public static Showreel get(Long id) {
   return find.ref(id);
 }