-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added camera group support to dashboard
- Loading branch information
Showing
26 changed files
with
610 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
cramp-api/src/main/java/org/eduze/fyp/api/model/CameraGroup.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* <Paste your header here> | ||
*/ | ||
package org.eduze.fyp.api.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.Lob; | ||
import javax.persistence.OneToMany; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
import javax.xml.bind.annotation.XmlTransient; | ||
import java.util.Set; | ||
|
||
@XmlRootElement | ||
@Entity | ||
@JsonIgnoreProperties("cameraConfigs") | ||
public class CameraGroup { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
private int id; | ||
|
||
@Column(unique = true) | ||
private String name; | ||
|
||
@Lob | ||
@Column(columnDefinition = "LONGBLOB") | ||
private byte[] map; | ||
|
||
@XmlTransient | ||
@OneToMany(mappedBy = "cameraGroup") | ||
private Set<CameraConfig> cameraConfigs; | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
public void setId(int id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public byte[] getMap() { | ||
return map; | ||
} | ||
|
||
public void setMap(byte[] map) { | ||
this.map = map; | ||
} | ||
|
||
public Set<CameraConfig> getCameraConfigs() { | ||
return cameraConfigs; | ||
} | ||
|
||
public void setCameraConfigs(Set<CameraConfig> cameraConfigs) { | ||
this.cameraConfigs = cameraConfigs; | ||
} | ||
|
||
public String toString() { | ||
return String.format("%s", name); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
cramp-core/src/main/java/org/eduze/fyp/core/db/dao/AbstractDAOImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* <Paste your header here> | ||
*/ | ||
package org.eduze.fyp.core.db.dao; | ||
|
||
import org.hibernate.Session; | ||
import org.hibernate.SessionFactory; | ||
|
||
public class AbstractDAOImpl implements AbstractDAO { | ||
|
||
protected SessionFactory sessionFactory; | ||
|
||
@Override | ||
public void save(Object object) { | ||
Session session = this.sessionFactory.openSession(); | ||
session.beginTransaction(); | ||
session.persist(object); | ||
session.getTransaction().commit(); | ||
session.close(); | ||
} | ||
|
||
public void setSessionFactory(SessionFactory sessionFactory) { | ||
this.sessionFactory = sessionFactory; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.