From 7e1d63dd9fd149e4934bf77095c8610fac786b04 Mon Sep 17 00:00:00 2001 From: Henri Herscher Date: Thu, 20 Oct 2005 13:40:58 +0000 Subject: First checkin git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@2 09dcff7a-b715-0410-9601-b79a96267cd0 --- .../sf/oreka/persistent/AnnotatedTestClass.java | 59 +++ .../net/sf/oreka/persistent/AnnotationsTest.java | 316 +++++++++++++ orkbasej/java/net/sf/oreka/persistent/Domain.java | 91 ++++ .../java/net/sf/oreka/persistent/HbnXmlTest.java | 195 ++++++++ .../net/sf/oreka/persistent/HbnXmlTestClass.java | 62 +++ .../java/net/sf/oreka/persistent/LoginString.java | 114 +++++ orkbasej/java/net/sf/oreka/persistent/RecPort.java | 33 ++ .../java/net/sf/oreka/persistent/RecPortFace.java | 49 ++ .../java/net/sf/oreka/persistent/RecProgram.java | 516 +++++++++++++++++++++ .../java/net/sf/oreka/persistent/RecSegment.java | 321 +++++++++++++ .../java/net/sf/oreka/persistent/RecSession.java | 79 ++++ orkbasej/java/net/sf/oreka/persistent/RecTape.java | 249 ++++++++++ orkbasej/java/net/sf/oreka/persistent/Service.java | 172 +++++++ orkbasej/java/net/sf/oreka/persistent/User.java | 133 ++++++ 14 files changed, 2389 insertions(+) create mode 100644 orkbasej/java/net/sf/oreka/persistent/AnnotatedTestClass.java create mode 100644 orkbasej/java/net/sf/oreka/persistent/AnnotationsTest.java create mode 100644 orkbasej/java/net/sf/oreka/persistent/Domain.java create mode 100644 orkbasej/java/net/sf/oreka/persistent/HbnXmlTest.java create mode 100644 orkbasej/java/net/sf/oreka/persistent/HbnXmlTestClass.java create mode 100644 orkbasej/java/net/sf/oreka/persistent/LoginString.java create mode 100644 orkbasej/java/net/sf/oreka/persistent/RecPort.java create mode 100644 orkbasej/java/net/sf/oreka/persistent/RecPortFace.java create mode 100644 orkbasej/java/net/sf/oreka/persistent/RecProgram.java create mode 100644 orkbasej/java/net/sf/oreka/persistent/RecSegment.java create mode 100644 orkbasej/java/net/sf/oreka/persistent/RecSession.java create mode 100644 orkbasej/java/net/sf/oreka/persistent/RecTape.java create mode 100644 orkbasej/java/net/sf/oreka/persistent/Service.java create mode 100644 orkbasej/java/net/sf/oreka/persistent/User.java (limited to 'orkbasej/java/net/sf/oreka/persistent') diff --git a/orkbasej/java/net/sf/oreka/persistent/AnnotatedTestClass.java b/orkbasej/java/net/sf/oreka/persistent/AnnotatedTestClass.java new file mode 100644 index 0000000..e75217a --- /dev/null +++ b/orkbasej/java/net/sf/oreka/persistent/AnnotatedTestClass.java @@ -0,0 +1,59 @@ +/* + * Oreka -- A media capture and retrieval platform + * + * Copyright (C) 2005, orecx LLC + * + * http://www.orecx.com + * + * This program is free software, distributed under the terms of + * the GNU General Public License. + * Please refer to http://www.gnu.org/copyleft/gpl.html + * + */ + +package net.sf.oreka.persistent; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratorType; +import javax.persistence.Id; + + +@Entity +public class AnnotatedTestClass { + + public enum TestEnum{value1, value2}; + + long Id; + TestEnum myEnum; + + String firstname; + String lastname; + public String getFirstname() { + return firstname; + } + public void setFirstname(String firstname) { + this.firstname = firstname; + } + @Id(generate=GeneratorType.AUTO) + public long getId() { + return Id; + } + public void setId(long id) { + Id = id; + } + public String getLastname() { + return lastname; + } + public void setLastname(String lastname) { + this.lastname = lastname; + } + + @Column(columnDefinition="varchar(255)") + public TestEnum getMyEnum() { + return myEnum; + } + public void setMyEnum(TestEnum myEnum) { + this.myEnum = myEnum; + } +} diff --git a/orkbasej/java/net/sf/oreka/persistent/AnnotationsTest.java b/orkbasej/java/net/sf/oreka/persistent/AnnotationsTest.java new file mode 100644 index 0000000..6b15796 --- /dev/null +++ b/orkbasej/java/net/sf/oreka/persistent/AnnotationsTest.java @@ -0,0 +1,316 @@ +/* + * Oreka -- A media capture and retrieval platform + * + * Copyright (C) 2005, orecx LLC + * + * http://www.orecx.com + * + * This program is free software, distributed under the terms of + * the GNU General Public License. + * Please refer to http://www.gnu.org/copyleft/gpl.html + * + */ + +package net.sf.oreka.persistent; + + + +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.Iterator; + +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.Transaction; +import org.hibernate.cfg.AnnotationConfiguration; +//import org.hibernate.tool.hbm2ddl.SchemaExport; +//import org.hibernate.ScrollableResults; + +public class AnnotationsTest { + + /** Creates a new instance of TestHibernate */ + public AnnotationsTest() { + } + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + +// Service srv1 = new Service(); +// srv1.setHostname("aoum"); +// +// srv1.setServiceClass(Service.ServiceClass.unkn); +// +// Method method = null; +// Object[] values = null; +// try { +// Class myClass = Service.ServiceClass.class; +// method = myClass.getDeclaredMethod( "values", new Class[0] ); +// values = (Object[]) method.invoke(null, new Object[0] ); +// } +// catch (Exception e) { +// int i = 0; +// } + +// if(true) {return;} + +// Date date = new Date(); +// long mili = date.getTime(); +// int sec = (int)(mili/1000); +// long mili2 = (long)sec*1000; +// Date date2 = new Date(mili2); + + AnnotationConfiguration config = (AnnotationConfiguration)new AnnotationConfiguration(); +// .setProperty("hibernate.dialect", "org.hibernate.dialect.HSQLDialect") +// .setProperty("hibernate.connection.driver_class", "org.hsqldb.jdbcDriver") +// .setProperty("hibernate.connection.url", "jdbc:hsqldb:mem:test") +// .setProperty("hibernate.connection.username", "sa") +// .setProperty("hibernate.connection.password", "") +// .setProperty("hibernate.connection.pool_size", "1") +// .setProperty("hibernate.connection.autocommit", "true") +// .setProperty("hibernate.cache.provider_class", "org.hibernate.cache.HashtableCacheProvider") +// .setProperty("hibernate.hbm2ddl.auto", "create-drop") +// .setProperty("hibernate.show_sql", "true"); +// config.configure("mysql.hbm.xml"); + config.configure("hsqldb.hbm.xml"); + + config.addAnnotatedClass(AnnotatedTestClass.class); + config.addAnnotatedClass(RecProgram.class); + config.addAnnotatedClass(RecSession.class); + config.addAnnotatedClass(RecSegment.class); + config.addAnnotatedClass(RecTape.class); + config.addAnnotatedClass(User.class); + config.addAnnotatedClass(LoginString.class); + config.addAnnotatedClass(Domain.class); + config.addAnnotatedClass(Service.class); + config.addAnnotatedClass(RecPort.class); + config.addAnnotatedClass(RecPortFace.class); + + SessionFactory sessions = config.buildSessionFactory(); + Session session = sessions.openSession(); + + Transaction tx = null; + + try { + /* + SchemaExport export = new SchemaExport(config); + export.setOutputFile("c:\\schema.sql"); + export.create(true,false); + */ + + // single insert +// tx = session.beginTransaction(); +// AnnotatedTestClass obj = new AnnotatedTestClass(); +// obj.setMyEnum(TestEnum.value2); +// session.save(obj); +// tx.commit(); + + // insert +// for (int i=0; i<100 ; i++) +// { +// tx = session.beginTransaction(); +// Domain obj = new Domain(); +// session.save(obj); +// tx.commit(); +// } + + /* + // iterator select + Iterator documents = session.createQuery( + "from Documents doc join doc.car") + .list() + .iterator(); + + while ( documents.hasNext() ) { + Object[] row = (Object[]) documents.next(); + Documents doc = (Documents)row[0]; + Car car = (Car)row[1]; + + //Documents doc = (Documents)documents.next(); + + System.out.println(doc.getId() + " " + car.getId()); + } + */ + /* + // scrollable select + ScrollableResults scrollDocs = session.createQuery( + "from RecSegment intr join intr.RecSession").scroll(); + if ( scrollDocs.last() ) { + System.out.println("Num res:" + scrollDocs.getRowNumber() + "\n\n"); + } + + scrollDocs.beforeFirst(); + while (scrollDocs.next()) + { + RecSegment doc = (RecSegment)scrollDocs.get(0); + RecSession car = (RecSession)scrollDocs.get(1); + System.out.println(doc.getId() + " " + car.getId()); + } + */ + + /* + // many to many insert + tx = session.beginTransaction(); + + RecProgram prog1 = new RecProgram(); + RecProgram prog2 = new RecProgram(); + RecSegment seg = new RecSegment(); + + HashSet programs = new HashSet(); + programs.add(prog1); + programs.add(prog2); + seg.setRecPrograms(programs); + + session.save(prog1); + session.save(prog2); + session.save(seg); + tx.commit(); + */ + /* + // Many to many select + ScrollableResults scrollDocs = session.createQuery( + "from RecSegment as seg join seg.recPrograms as prg where prg.id=2").scroll(); + if ( scrollDocs.last() ) { + System.out.println("Num res:" + scrollDocs.getRowNumber() + "\n\n"); + } + + scrollDocs.beforeFirst(); + while (scrollDocs.next()) + { + RecSegment seg = (RecSegment)scrollDocs.get(0); + RecProgram prg = (RecProgram)scrollDocs.get(1); + System.out.println(seg.getId() + " " + prg.getId()); + } + */ + + /* + // one to many create + tx = session.beginTransaction(); + + RecProgram prog = new RecProgram(); + User user = new User(); + prog.setTargetUser(user); + + session.save(user); + session.save(prog); + tx.commit(); + */ + /* + // one to many select + ScrollableResults scrollDocs = session.createQuery( + "from RecProgram as prg join prg.targetUser as tgt").scroll(); + if ( scrollDocs.last() ) { + System.out.println("Num res:" + scrollDocs.getRowNumber() + "\n\n"); + } + + scrollDocs.beforeFirst(); + while (scrollDocs.next()) + { + RecProgram prg = (RecProgram)scrollDocs.get(0); + User tgt = (User)scrollDocs.get(1); + System.out.println(prg.getId() + " " + tgt.getId()); + } + */ + + // multi-session stuff +// tx = session.beginTransaction(); +// RecTape obj = new RecTape(); +// Service srv = new Service(); +// obj.setService(srv); +// srv.setName("service1"); +// session.save(srv); +// session.save(obj); +// tx.commit(); +// session.close(); +// +// session = sessions.openSession(); +// tx = session.beginTransaction(); +// obj = new RecTape(); +// obj.setService(srv); +// session.save(obj); +// tx.commit(); +// session.close(); + +// tx = session.beginTransaction(); +// //Service.retrieveByName("toto", session); +// RecSegment seg = new RecSegment(); +// seg.setLoginString("too"); +// seg.setDuration(56); +// seg.setDirection(Direction.in); +// seg.setRemoteParty("135"); +// session.save(seg); +// +// java.util.List recSegments = session.createQuery( +// "from RecSegment as seg where seg.remoteParty = :rp") +// .setString("rp", "135") +// .list(); +// if (recSegments.size() > 0) { +// RecSegment result = (RecSegment)recSegments.get(0); +// System.out.println(result.getLoginString() + " " + result.getDirection().name()); +// } + + // enum stuff +// tx = session.beginTransaction(); +// //Service.retrieveByName("toto", session); +// Service srv = new Service(); +// srv.setHostname("aoum"); +// srv.setServiceClass(ServiceClass.audio); +// session.save(srv); +// +// java.util.List services = session.createQuery( +// "from Service as srv where srv.hostname = :rp") +// .setString("rp", "aoum") +// .list(); +// if (services.size() > 0) { +// Service result = (Service)services.get(0); +// System.out.println(result.getHostname() + result.getServiceClass().name()); +// } + + + +// tx = session.beginTransaction(); +// +// Iterator portFaces = session.createQuery( +// "from RecPortFace") +// .list() +// .iterator(); + + tx = session.beginTransaction(); + System.out.println("hello"); + RecSegment seg = new RecSegment(); + GregorianCalendar cal = new GregorianCalendar(); + Date now = cal.getTime(); + seg.setTimestamp(now); + session.save(seg); + + GregorianCalendar cal2 = new GregorianCalendar(); + cal2.setTimeInMillis(cal.getTimeInMillis() + 1000); + + Iterator segments = session.createQuery( + "from RecSegment as seg where seg.timestamp= :date") + //.setDate("date", now) + //.setDate("date2", new Date(time+10000000)) + .setCalendar("date", cal) + .list() + .iterator(); + if(segments.hasNext()) { + RecSegment seg2 = (RecSegment)segments.next(); + System.out.println("db timestamp:" + seg2.getTimestamp().getTime() + " my:" + now.getTime()); + } + else { + System.out.println("fail"); + } + + } + catch ( HibernateException he ) { + if ( tx != null ) tx.rollback(); + throw he; + } + finally { + session.close(); + } + } + +} \ No newline at end of file diff --git a/orkbasej/java/net/sf/oreka/persistent/Domain.java b/orkbasej/java/net/sf/oreka/persistent/Domain.java new file mode 100644 index 0000000..edb463d --- /dev/null +++ b/orkbasej/java/net/sf/oreka/persistent/Domain.java @@ -0,0 +1,91 @@ +/* + * Oreka -- A media capture and retrieval platform + * + * Copyright (C) 2005, orecx LLC + * + * http://www.orecx.com + * + * This program is free software, distributed under the terms of + * the GNU General Public License. + * Please refer to http://www.gnu.org/copyleft/gpl.html + * + */ + +/** + * + */ +package net.sf.oreka.persistent; +import javax.persistence.Entity; +import javax.persistence.GeneratorType; +import javax.persistence.Id; + +/** + * @hibernate.class + */ +@Entity +public class Domain { + + private int id; + private String name = ""; + private String description = ""; + + /** + * + */ + public Domain() { + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the description. + */ + public String getDescription() { + return description; + } + + + /** + * @param description The description to set. + */ + public void setDescription(String description) { + this.description = description; + } + + + /** + * @hibernate.id + * generator-class="native" + * @return Returns the id. + */ + @Id(generate=GeneratorType.AUTO) + public int getId() { + return id; + } + + + /** + * @param id The id to set. + */ + public void setId(int id) { + this.id = id; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the name. + */ + public String getName() { + return name; + } + + + /** + * @param name The name to set. + */ + public void setName(String name) { + this.name = name; + } +} diff --git a/orkbasej/java/net/sf/oreka/persistent/HbnXmlTest.java b/orkbasej/java/net/sf/oreka/persistent/HbnXmlTest.java new file mode 100644 index 0000000..2554a70 --- /dev/null +++ b/orkbasej/java/net/sf/oreka/persistent/HbnXmlTest.java @@ -0,0 +1,195 @@ +/* + * Oreka -- A media capture and retrieval platform + * + * Copyright (C) 2005, orecx LLC + * + * http://www.orecx.com + * + * This program is free software, distributed under the terms of + * the GNU General Public License. + * Please refer to http://www.gnu.org/copyleft/gpl.html + * + */ + +package net.sf.oreka.persistent; + +import org.hibernate.cfg.Configuration; +import org.hibernate.SessionFactory; +import org.hibernate.Session; +import org.hibernate.Transaction; +import org.hibernate.HibernateException; +//import org.hibernate.tool.hbm2ddl.SchemaExport; +//import org.hibernate.ScrollableResults; + +public class HbnXmlTest { + + /** Creates a new instance of TestHibernate */ + public HbnXmlTest() { + } + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + + Configuration config = new Configuration() + .configure("mysql.hbm.xml"); + + config.addClass(HbnXmlTestClass.class); + SessionFactory sessions = config.buildSessionFactory(); + Session session = sessions.openSession(); + + Transaction tx = null; + + try { + /* + SchemaExport export = new SchemaExport(config); + export.setOutputFile("c:\\schema.sql"); + export.create(true,false); + */ + + for (int i=0; i<100 ; i++) + { + tx = session.beginTransaction(); + + HbnXmlTestClass obj = new HbnXmlTestClass(); + + session.save(obj); + tx.commit(); + } + + + // insert + /* + for (int i=0; i<100 ; i++) + { + tx = session.beginTransaction(); + + RecSession RecSession = new RecSession(); + RecSession.setDuration(i); + + + RecSegment intr1 = new RecSegment(); + intr1.setRecSession(RecSession); + intr1.setLocalParty(i + " " + 1); + intr1.setDuration(23); + RecSegment intr2 = new RecSegment(); + intr2.setRecSession(RecSession); + intr2.setLocalParty(i + " " + 2); + intr2.setDuration(45); + + session.save(RecSession); + session.save(intr1); + session.save(intr2); + tx.commit(); + } +*/ + /* + // iterator select + Iterator documents = session.createQuery( + "from Documents doc join doc.car") + .list() + .iterator(); + + while ( documents.hasNext() ) { + Object[] row = (Object[]) documents.next(); + Documents doc = (Documents)row[0]; + Car car = (Car)row[1]; + + //Documents doc = (Documents)documents.next(); + + System.out.println(doc.getId() + " " + car.getId()); + } + */ + /* + // scrollable select + ScrollableResults scrollDocs = session.createQuery( + "from RecSegment intr join intr.RecSession").scroll(); + if ( scrollDocs.last() ) { + System.out.println("Num res:" + scrollDocs.getRowNumber() + "\n\n"); + } + + scrollDocs.beforeFirst(); + while (scrollDocs.next()) + { + RecSegment doc = (RecSegment)scrollDocs.get(0); + RecSession car = (RecSession)scrollDocs.get(1); + System.out.println(doc.getId() + " " + car.getId()); + } + */ + + /* + // many to many insert + tx = session.beginTransaction(); + + RecProgram prog1 = new RecProgram(); + RecProgram prog2 = new RecProgram(); + RecSegment seg = new RecSegment(); + + HashSet programs = new HashSet(); + programs.add(prog1); + programs.add(prog2); + seg.setRecPrograms(programs); + + session.save(prog1); + session.save(prog2); + session.save(seg); + tx.commit(); + */ + + // Many to many select + /* + ScrollableResults scrollDocs = session.createQuery( + "from RecSegment as seg join seg.recPrograms as prg where prg.id=2").scroll(); + if ( scrollDocs.last() ) { + System.out.println("Num res:" + scrollDocs.getRowNumber() + "\n\n"); + } + + scrollDocs.beforeFirst(); + while (scrollDocs.next()) + { + RecSegment seg = (RecSegment)scrollDocs.get(0); + RecProgram prg = (RecProgram)scrollDocs.get(1); + System.out.println(seg.getId() + " " + prg.getId()); + } + */ + + /* + // one to one create + tx = session.beginTransaction(); + + RecProgram prog = new RecProgram(); + User user = new User(); + prog.setTargetUser(user); + + session.save(user); + session.save(prog); + tx.commit(); + */ + /* + // one to one select + ScrollableResults scrollDocs = session.createQuery( + "from RecProgram as prg join prg.targetUser as tgt").scroll(); + if ( scrollDocs.last() ) { + System.out.println("Num res:" + scrollDocs.getRowNumber() + "\n\n"); + } + + scrollDocs.beforeFirst(); + while (scrollDocs.next()) + { + RecProgram prg = (RecProgram)scrollDocs.get(0); + User tgt = (User)scrollDocs.get(1); + System.out.println(prg.getId() + " " + tgt.getId()); + } + */ + } + catch ( HibernateException he ) { + if ( tx != null ) tx.rollback(); + throw he; + } + finally { + session.close(); + } + } + +} diff --git a/orkbasej/java/net/sf/oreka/persistent/HbnXmlTestClass.java b/orkbasej/java/net/sf/oreka/persistent/HbnXmlTestClass.java new file mode 100644 index 0000000..8706455 --- /dev/null +++ b/orkbasej/java/net/sf/oreka/persistent/HbnXmlTestClass.java @@ -0,0 +1,62 @@ +/* + * Oreka -- A media capture and retrieval platform + * + * Copyright (C) 2005, orecx LLC + * + * http://www.orecx.com + * + * This program is free software, distributed under the terms of + * the GNU General Public License. + * Please refer to http://www.gnu.org/copyleft/gpl.html + * + */ + +package net.sf.oreka.persistent; + +/** + * @hibernate.class + */ +public class HbnXmlTestClass { + + long Id; + String firstname = ""; + String lastname = ""; + + /** + * @hibernate.property + * not-null="true" + * @return Returns the filename. + */ + public String getFirstname() { + return firstname; + } + + public void setFirstname(String firstname) { + this.firstname = firstname; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the filename. + */ + public String getLastname() { + return lastname; + } + + public void setLastname(String lastname) { + this.lastname = lastname; + } + + /** + * @hibernate.id + * generator-class="native" + */ + public long getId() { + return Id; + } + + public void setId(long id) { + Id = id; + } +} diff --git a/orkbasej/java/net/sf/oreka/persistent/LoginString.java b/orkbasej/java/net/sf/oreka/persistent/LoginString.java new file mode 100644 index 0000000..ad44057 --- /dev/null +++ b/orkbasej/java/net/sf/oreka/persistent/LoginString.java @@ -0,0 +1,114 @@ +/* + * Oreka -- A media capture and retrieval platform + * + * Copyright (C) 2005, orecx LLC + * + * http://www.orecx.com + * + * This program is free software, distributed under the terms of + * the GNU General Public License. + * Please refer to http://www.gnu.org/copyleft/gpl.html + * + */ + +/** + * + */ +package net.sf.oreka.persistent; + +import javax.persistence.Entity; +import javax.persistence.GeneratorType; +import javax.persistence.Id; +import javax.persistence.ManyToOne; + +/** + * @hibernate.class + */ +@Entity +public class LoginString { + + private int id; + private String loginString; + private User user; + private Domain domain; + + /** + * @hibernate.many-to-one + * @return Returns the domain. + */ + @ManyToOne + public Domain getDomain() { + return domain; + } + + + /** + * @param domain The domain to set. + */ + public void setDomain(Domain domain) { + this.domain = domain; + } + + + /** + * @hibernate.id + * generator-class="native" + * @return Returns the id. + */ + @Id(generate=GeneratorType.AUTO) + public int getId() { + return id; + } + + + /** + * @param id The id to set. + */ + public void setId(int id) { + this.id = id; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the loginString. + */ + public String getLoginString() { + return loginString; + } + + + /** + * @param loginString The loginString to set. + */ + public void setLoginString(String loginString) { + this.loginString = loginString; + } + + + /** + * @hibernate.many-to-one + * @return Returns the user. + */ + @ManyToOne + public User getUser() { + return user; + } + + + /** + * @param user The user to set. + */ + public void setUser(User user) { + this.user = user; + } + + + /** + * + */ + public LoginString() { + } + +} diff --git a/orkbasej/java/net/sf/oreka/persistent/RecPort.java b/orkbasej/java/net/sf/oreka/persistent/RecPort.java new file mode 100644 index 0000000..9886bdc --- /dev/null +++ b/orkbasej/java/net/sf/oreka/persistent/RecPort.java @@ -0,0 +1,33 @@ +/* + * Oreka -- A media capture and retrieval platform + * + * Copyright (C) 2005, orecx LLC + * + * http://www.orecx.com + * + * This program is free software, distributed under the terms of + * the GNU General Public License. + * Please refer to http://www.gnu.org/copyleft/gpl.html + * + */ + +package net.sf.oreka.persistent; + +import javax.persistence.Entity; +import javax.persistence.GeneratorType; +import javax.persistence.Id; + +@Entity +public class RecPort { + + private int id; + + @Id(generate=GeneratorType.AUTO) + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} diff --git a/orkbasej/java/net/sf/oreka/persistent/RecPortFace.java b/orkbasej/java/net/sf/oreka/persistent/RecPortFace.java new file mode 100644 index 0000000..2824926 --- /dev/null +++ b/orkbasej/java/net/sf/oreka/persistent/RecPortFace.java @@ -0,0 +1,49 @@ +/* + * Oreka -- A media capture and retrieval platform + * + * Copyright (C) 2005, orecx LLC + * + * http://www.orecx.com + * + * This program is free software, distributed under the terms of + * the GNU General Public License. + * Please refer to http://www.gnu.org/copyleft/gpl.html + * + */ + +package net.sf.oreka.persistent; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.ManyToOne; + +@Entity +public class RecPortFace { + + private RecPort recPort; + private Service service; + private String name; + + @Id + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + @ManyToOne + public RecPort getRecPort() { + return recPort; + } + public void setRecPort(RecPort recPort) { + this.recPort = recPort; + } + @ManyToOne + public Service getService() { + return service; + } + public void setService(Service service) { + this.service = service; + } + +} diff --git a/orkbasej/java/net/sf/oreka/persistent/RecProgram.java b/orkbasej/java/net/sf/oreka/persistent/RecProgram.java new file mode 100644 index 0000000..48d8bdb --- /dev/null +++ b/orkbasej/java/net/sf/oreka/persistent/RecProgram.java @@ -0,0 +1,516 @@ +/* + * Oreka -- A media capture and retrieval platform + * + * Copyright (C) 2005, orecx LLC + * + * http://www.orecx.com + * + * This program is free software, distributed under the terms of + * the GNU General Public License. + * Please refer to http://www.gnu.org/copyleft/gpl.html + * + */ + +/** + * + */ +package net.sf.oreka.persistent; + +import java.util.Collection; +import java.util.Date; + +import javax.persistence.Entity; +import javax.persistence.GeneratorType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.ManyToOne; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +import net.sf.oreka.Cycle; +import net.sf.oreka.Direction; + +/** + * @hibernate.class + */ +@Entity +public class RecProgram { + + private int id; + private String name = ""; + private String description = ""; + private boolean discarded = false; + private Date timestamp; + private User owner; + private boolean active = true; + private Direction direction = Direction.ALL; + private int minDuration = 0; + private int maxDuration = 0; + private double randomPercent = 0.0; + private Cycle cycle = Cycle.permanent; + private int startDay = 0; + private int stopDay = 0; + private Date startTime; + private Date stopTime; + private int recPerCycle = 0; + private int recordedSoFar = 0; + private String localParty = ""; + private String remoteParty = ""; + private int keepForHours = 0; + private User targetUser; + private RecPort targetPort; + + //private Set RecSegments; + private Collection recSegments; + + /** + * @hibernate.set + * lazy="true" + * table="PrgToSeg" + * @hibernate.collection-key + * column="RecProgram" + * @hibernate.collection-many-to-many + * column="RecSegment" + * class="net.sf.oreka.persistent.RecSegment" + * @return Returns the recSegments. + */ + @ManyToMany +// ( +// targetEntity="net.sf.oreka.persistent.RecSegment" +// ) + @JoinTable( + table=@Table(name="ProgToSeg"), + joinColumns={@JoinColumn(name="ProgId")}, + inverseJoinColumns={@JoinColumn(name="SegId")} + ) + public Collection getRecSegments() { + return recSegments; + } + + + /** + * @param recSegments The recSegments to set. + */ + public void setRecSegments(Collection recSegments) { + this.recSegments = recSegments; + } + + + public RecProgram () { + direction = Direction.ALL; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the active. + */ + public boolean isActive() { + return active; + } + + + /** + * @param active The active to set. + */ + public void setActive(boolean active) { + this.active = active; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the cycle. + */ + public Cycle getCycle() { + return cycle; + } + + + /** + * @param cycle The cycle to set. + */ + public void setCycle(Cycle cycle) { + this.cycle = cycle; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the description. + */ + public String getDescription() { + return description; + } + + + /** + * @param description The description to set. + */ + public void setDescription(String description) { + this.description = description; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the direction. + */ + public Direction getDirection() { + return direction; + } + + + /** + * @param direction The direction to set. + */ + public void setDirection(Direction direction) { + this.direction = direction; + } + + + /** + * @return Returns the discarded. + */ + public boolean isDiscarded() { + return discarded; + } + + + /** + * @param discarded The discarded to set. + */ + public void setDiscarded(boolean discarded) { + this.discarded = discarded; + } + + + /** + * @hibernate.id + * generator-class="native" + * @return Returns the id. + */ + @Id(generate=GeneratorType.AUTO) + public int getId() { + return id; + } + + + /** + * @param id The id to set. + */ + public void setId(int id) { + this.id = id; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the keepForHours. + */ + public int getKeepForHours() { + return keepForHours; + } + + + /** + * @param keepForHours The keepForHours to set. + */ + public void setKeepForHours(int keepForHours) { + this.keepForHours = keepForHours; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the localParty. + */ + public String getLocalParty() { + return localParty; + } + + + /** + * @param localParty The localParty to set. + */ + public void setLocalParty(String localParty) { + this.localParty = localParty; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the maxDuration. + */ + public int getMaxDuration() { + return maxDuration; + } + + + /** + * @param maxDuration The maxDuration to set. + */ + public void setMaxDuration(int maxDuration) { + this.maxDuration = maxDuration; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the minDuration. + */ + public int getMinDuration() { + return minDuration; + } + + + /** + * @param minDuration The minDuration to set. + */ + public void setMinDuration(int minDuration) { + this.minDuration = minDuration; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the name. + */ + public String getName() { + return name; + } + + + /** + * @param name The name to set. + */ + public void setName(String name) { + this.name = name; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the randomPercent. + */ + public double getRandomPercent() { + return randomPercent; + } + + + /** + * @param randomPercent The randomPercent to set. + */ + public void setRandomPercent(double randomPercent) { + this.randomPercent = randomPercent; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the recordedSoFar. + */ + public int getRecordedSoFar() { + return recordedSoFar; + } + + + /** + * @param recordedSoFar The recordedSoFar to set. + */ + public void setRecordedSoFar(int recordedSoFar) { + this.recordedSoFar = recordedSoFar; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the recPerCycle. + */ + public int getRecPerCycle() { + return recPerCycle; + } + + + /** + * @param recPerCycle The recPerCycle to set. + */ + public void setRecPerCycle(int recPerCycle) { + this.recPerCycle = recPerCycle; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the remoteParty. + */ + public String getRemoteParty() { + return remoteParty; + } + + + /** + * @param remoteParty The remoteParty to set. + */ + public void setRemoteParty(String remoteParty) { + this.remoteParty = remoteParty; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the startDay. + */ + public int getStartDay() { + return startDay; + } + + + /** + * @param startDay The startDay to set. + */ + public void setStartDay(int startDay) { + this.startDay = startDay; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the startTime. + */ + public Date getStartTime() { + return startTime; + } + + + /** + * @param startTime The startTime to set. + */ + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the stopDay. + */ + public int getStopDay() { + return stopDay; + } + + + /** + * @param stopDay The stopDay to set. + */ + public void setStopDay(int stopDay) { + this.stopDay = stopDay; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the stopTime. + */ + public Date getStopTime() { + return stopTime; + } + + + /** + * @param stopTime The stopTime to set. + */ + public void setStopTime(Date stopTime) { + this.stopTime = stopTime; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the targetPort. + */ + @OneToOne + public RecPort getTargetPort() { + return targetPort; + } + + + /** + * @param targetPort The targetPort to set. + */ + public void setTargetPort(RecPort targetPort) { + this.targetPort = targetPort; + } + + /** + * @hibernate.many-to-one + * @return Returns the targetUser. + */ + @ManyToOne + public User getTargetUser() { + return targetUser; + } + + + + /** + * @param targetUser The targetUser to set. + */ + public void setTargetUser(User targetUser) { + this.targetUser = targetUser; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the timestamp. + */ + public Date getTimestamp() { + return timestamp; + } + + + /** + * @param timestamp The timestamp to set. + */ + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + + + /** + * @hibernate.many-to-one + * @return Returns the owner. + */ + @ManyToOne + public User getOwner() { + return owner; + } + + + + /** + * @param owner The owner to set. + */ + public void setOwner(User owner) { + this.owner = owner; + } +} diff --git a/orkbasej/java/net/sf/oreka/persistent/RecSegment.java b/orkbasej/java/net/sf/oreka/persistent/RecSegment.java new file mode 100644 index 0000000..716de5b --- /dev/null +++ b/orkbasej/java/net/sf/oreka/persistent/RecSegment.java @@ -0,0 +1,321 @@ +/* + * Oreka -- A media capture and retrieval platform + * + * Copyright (C) 2005, orecx LLC + * + * http://www.orecx.com + * + * This program is free software, distributed under the terms of + * the GNU General Public License. + * Please refer to http://www.gnu.org/copyleft/gpl.html + * + */ + +package net.sf.oreka.persistent; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; + +import javax.persistence.Entity; +import javax.persistence.GeneratorType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.ManyToOne; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Transient; + +import net.sf.oreka.Direction; + +/** + * @hibernate.class + */ +@Entity +public class RecSegment { + + private int id; + private RecSession recSession; + private long recSessionOffset; + private RecTape recTape; + private long recTapeOffset; + private Date timestamp = new Date(0); + private long duration; + private String localParty = ""; + private String localEntryPoint = ""; + private String remoteParty = ""; + private Direction direction;; + private User user; + private String loginString = ""; + private RecPort port; + //private java.util.Set RecPrograms; + private Collection recPrograms; + + public RecSegment() { + direction = Direction.UNKN; + recPrograms = new ArrayList(); + } + + /** + * @hibernate.property + * + * @hibernate.column + * name="direction" + * index="direction" + * not-null="true" + * @return Returns the direction. + */ + public Direction getDirection() { + return direction; + } + + /** + * @param direction The direction to set. + */ + public void setDirection(Direction direction) { + this.direction = direction; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the duration. + */ + public long getDuration() { + return duration; + } + + /** + * @param duration The duration to set. + */ + public void setDuration(long duration) { + this.duration = duration; + } + + /** + * @hibernate.id + * generator-class="native" + * @hibernate.collection-many-to-many + * column="RecSegmentId" + * class="RecProgram" + * @return Returns the id. + */ + @Id(generate=GeneratorType.AUTO) + public int getId() { + return id; + } + + /** + * @param id The id to set. + */ + public void setId(int id) { + this.id = id; + } + + /** + * @hibernate.property + * + * @hibernate.column + * name="localParty" + * index="localParty" + * not-null="true" + * + * @return Returns the localParty. + */ + public String getLocalParty() { + return localParty; + } + + /** + * @param localParty The localParty to set. + */ + public void setLocalParty(String localParty) { + this.localParty = localParty; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the loginString. + */ + public String getLoginString() { + return loginString; + } + + /** + * @param loginString The loginString to set. + */ + public void setLoginString(String loginString) { + this.loginString = loginString; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the remoteParty. + */ + public String getRemoteParty() { + return remoteParty; + } + + /** + * @param remoteParty The remoteParty to set. + */ + public void setRemoteParty(String remoteParty) { + this.remoteParty = remoteParty; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the RecTapeOffset. + */ + public long getRecTapeOffset() { + return recTapeOffset; + } + + /** + * @param RecTapeOffset The RecTapeOffset to set. + */ + public void setRecTapeOffset(long recTapeOffset) { + this.recTapeOffset = recTapeOffset; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the timestamp. + */ + public Date getTimestamp() { + return timestamp; + } + + /** + * @param timestamp The timestamp to set. + */ + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + + /** + * @hibernate.many-to-one + * @return Returns the RecSession. + */ + @ManyToOne + public RecSession getRecSession() { + return recSession; + } + + /** + * @param RecSession The RecSession to set. + */ + public void setRecSession(RecSession recSession) { + this.recSession = recSession; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the RecSessionOffset. + */ + public long getRecSessionOffset() { + return recSessionOffset; + } + + /** + * @param RecSessionOffset The RecSessionOffset to set. + */ + public void setRecSessionOffset(long recSessionOffset) { + this.recSessionOffset = recSessionOffset; + } + + /** + * @hibernate.many-to-one + * @return Returns the recTape. + */ + @ManyToOne + public RecTape getRecTape() { + return recTape; + } + + + /** + * @param recTape The recTape to set. + */ + public void setRecTape(RecTape recTape) { + this.recTape = recTape; + } + + /** + * @hibernate.set + * lazy="true" + * table="PrgToSeg" + * @hibernate.collection-key + * column="RecSegment" + * @hibernate.collection-many-to-many + * column="RecProgram" + * class="net.sf.oreka.persistent.RecProgram" + * @return Returns the recPrograms. + */ + @ManyToMany + @JoinTable( + table=@Table(name="ProgToSeg"), + joinColumns={@JoinColumn(name="SegId")}, + inverseJoinColumns={@JoinColumn(name="ProgId")} + ) + public Collection getRecPrograms() { + return recPrograms; + } + + + /** + * @param recPrograms The recPrograms to set. + */ + public void setRecPrograms(Collection recPrograms) { + this.recPrograms = recPrograms; + } + + /** + * @hibernate.many-to-one + * @return Returns the user. + */ + @ManyToOne + public User getUser() { + return user; + } + + + /** + * @param user The user to set. + */ + public void setUser(User user) { + this.user = user; + } + + public String getLocalEntryPoint() { + return localEntryPoint; + } + + public void setLocalEntryPoint(String localEntryPoint) { + this.localEntryPoint = localEntryPoint; + } + + @Transient + public long getStopTime() { + return timestamp.getTime() + duration; + } + + @OneToOne + public RecPort getPort() { + return port; + } + + public void setPort(RecPort port) { + this.port = port; + } + + + +} diff --git a/orkbasej/java/net/sf/oreka/persistent/RecSession.java b/orkbasej/java/net/sf/oreka/persistent/RecSession.java new file mode 100644 index 0000000..214f678 --- /dev/null +++ b/orkbasej/java/net/sf/oreka/persistent/RecSession.java @@ -0,0 +1,79 @@ +/* + * Oreka -- A media capture and retrieval platform + * + * Copyright (C) 2005, orecx LLC + * + * http://www.orecx.com + * + * This program is free software, distributed under the terms of + * the GNU General Public License. + * Please refer to http://www.gnu.org/copyleft/gpl.html + * + */ + +package net.sf.oreka.persistent; + +import java.util.Date; + +import javax.persistence.Entity; +import javax.persistence.GeneratorType; +import javax.persistence.Id; +import javax.persistence.Transient; + +/** + * @hibernate.class + */ +@Entity +public class RecSession { + private int id; + private Date timestamp = new Date(0); + private long duration; + + /** + * @hibernate.property + * not-null="true" + * @return + */ + public long getDuration() { + return duration; + } + + public void setDuration(long duration) { + this.duration = duration; + } + + /** + * @hibernate.id + * generator-class="native" + */ + @Id(generate=GeneratorType.AUTO) + public int getId() { + return id; + } + + + public void setId(int id) { + this.id = id; + } + + /** + * @hibernate.property + * @return + */ + public Date getTimestamp() { + return timestamp; + } + + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + + @Transient + public long getStopTime() { + return timestamp.getTime() + duration; + } + + public void setStopTime(long stopTime) { + duration = stopTime - timestamp.getTime(); + } +} diff --git a/orkbasej/java/net/sf/oreka/persistent/RecTape.java b/orkbasej/java/net/sf/oreka/persistent/RecTape.java new file mode 100644 index 0000000..d5f6d73 --- /dev/null +++ b/orkbasej/java/net/sf/oreka/persistent/RecTape.java @@ -0,0 +1,249 @@ +/* + * Oreka -- A media capture and retrieval platform + * + * Copyright (C) 2005, orecx LLC + * + * http://www.orecx.com + * + * This program is free software, distributed under the terms of + * the GNU General Public License. + * Please refer to http://www.gnu.org/copyleft/gpl.html + * + */ + +package net.sf.oreka.persistent; + +import java.util.Date; + +import javax.persistence.Entity; +import javax.persistence.GeneratorType; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.OneToOne; +import javax.persistence.Transient; + +import net.sf.oreka.Direction; + +/** + * @hibernate.class + */ +@Entity +public class RecTape { + + private int id; + private Date timestamp = new Date(0); + private long duration; + private String filename = ""; + private Service service; + private String localParty = ""; + private String localEntryPoint = ""; + private String remoteParty = ""; + private Direction direction; + private RecPort port; + private Date expiryTimestamp = new Date(0); + + public RecTape() + { + // Defaults + direction = Direction.UNKN; + } + + /** + * @hibernate.property + * @hibernate.column + * name="direction" + * index="direction" + * not-null="true" + * @return Returns the direction. + */ + public Direction getDirection() { + return direction; + } + + /** + * @param direction The direction to set. + */ + public void setDirection(Direction direction) { + this.direction = direction; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the duration. + */ + public long getDuration() { + return duration; + } + + /** + * @param duration The duration to set. + */ + public void setDuration(long duration) { + this.duration = duration; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the expiryTimestamp. + */ + public Date getExpiryTimestamp() { + return expiryTimestamp; + } + + /** + * @param expiryTimestamp The expiryTimestamp to set. + */ + public void setExpiryTimestamp(Date expiryTimestamp) { + this.expiryTimestamp = expiryTimestamp; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the filename. + */ + public String getFilename() { + return filename; + } + + /** + * @param filename The filename to set. + */ + public void setFilename(String filename) { + this.filename = filename; + } + + /** + * @hibernate.id + * generator-class="native" + * @return Returns the id. + */ + @Id(generate=GeneratorType.AUTO) + public int getId() { + return id; + } + + /** + * @param id The id to set. + */ + public void setId(int id) { + this.id = id; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the localParty. + */ + public String getLocalParty() { + return localParty; + } + + /** + * @param localParty The localParty to set. + */ + public void setLocalParty(String localParty) { + this.localParty = localParty; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the port. + */ + @OneToOne + public RecPort getPort() { + return port; + } + + /** + * @param port The port to set. + */ + public void setPort(RecPort port) { + this.port = port; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the remoteParty. + */ + public String getRemoteParty() { + return remoteParty; + } + + /** + * @param remoteParty The remoteParty to set. + */ + public void setRemoteParty(String remoteParty) { + this.remoteParty = remoteParty; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the timestamp. + */ + public Date getTimestamp() { + return timestamp; + } + + /** + * @param timestamp The timestamp to set. + */ + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + + /** + * @hibernate.many-to-one + * @return Returns the service. + */ + @ManyToOne + public Service getService() { + return service; + } + + + /** + * @param server The service to set. + */ + public void setService(Service service) { + this.service = service; + } + + public String getLocalEntryPoint() { + return localEntryPoint; + } + + public void setLocalEntryPoint(String localEntryPoint) { + this.localEntryPoint = localEntryPoint; + } + + @Transient + public long getStopTime() { + return timestamp.getTime() + duration; + } + + @Transient + public String getUrl() { + + if(service != null) { + return service.getFileServeProtocol() + "://" + + service.getHostname() + ":" + service.getFileServeTcpPort() + + "/" + service.getFileServePath() + "/" + filename; + } + else { + return ""; + } + } + + @Transient + public String getPlayUrl() { + + return "javascript:play('" + getUrl() + "')"; + } + +} diff --git a/orkbasej/java/net/sf/oreka/persistent/Service.java b/orkbasej/java/net/sf/oreka/persistent/Service.java new file mode 100644 index 0000000..361676a --- /dev/null +++ b/orkbasej/java/net/sf/oreka/persistent/Service.java @@ -0,0 +1,172 @@ +/* + * Oreka -- A media capture and retrieval platform + * + * Copyright (C) 2005, orecx LLC + * + * http://www.orecx.com + * + * This program is free software, distributed under the terms of + * the GNU General Public License. + * Please refer to http://www.gnu.org/copyleft/gpl.html + * + */ + +/** + * + */ +package net.sf.oreka.persistent; + +import javax.persistence.Entity; +import javax.persistence.GeneratorType; +import javax.persistence.Id; + +import net.sf.oreka.ServiceClass; + +/** + * @hibernate.class + */ +@Entity +public class Service { + + private int id; + private String name = ""; + private String hostname = ""; + private int tcpPort = 0; + private String fileServeProtocol = ""; + private int fileServeTcpPort = 0; + private String fileServePath = ""; + private ServiceClass serviceClass; + private boolean recordMaster = false; + + /** + * + */ + public Service() { + serviceClass = ServiceClass.unkn; + } + + /** + * + * @hibernate.property + * not-null="true" + * @return Returns the fileServePath. + */ + public String getFileServePath() { + return fileServePath; + } + + + /** + * @param fileServePath The fileServePath to set. + */ + public void setFileServePath(String fileServePath) { + this.fileServePath = fileServePath; + } + + public int getFileServeTcpPort() { + return fileServeTcpPort; + } + + public void setFileServeTcpPort(int fileServeTcpPort) { + this.fileServeTcpPort = fileServeTcpPort; + } + + public int getTcpPort() { + return tcpPort; + } + + public void setTcpPort(int tcpPort) { + this.tcpPort = tcpPort; + } + + /** + * @hibernate.property + * not-null="true" + * @return Returns the fileServeProtocol. + */ + public String getFileServeProtocol() { + return fileServeProtocol; + } + + + /** + * @param fileServeProtocol The fileServeProtocol to set. + */ + public void setFileServeProtocol(String fileServeProtocol) { + this.fileServeProtocol = fileServeProtocol; + } + + + /** + * @hibernate.property + * unique="true" + * not-null="true" + * @return Returns the gUID. + */ + public String getName() { + return name; + } + + + /** + * @param name The name to set. + */ + public void setName(String name) { + this.name = name; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the hostname. + */ + public String getHostname() { + return hostname; + } + + + /** + * @param hostname The hostname to set. + */ + public void setHostname(String hostname) { + this.hostname = hostname; + } + + + /** + * @hibernate.id + * generator-class="native" + * @return Returns the id. + */ + @Id(generate=GeneratorType.AUTO) + public int getId() { + return id; + } + + + /** + * @param id The id to set. + */ + public void setId(int id) { + this.id = id; + } + + public ServiceClass getServiceClass() { + return serviceClass; + } + + public void setServiceClass(ServiceClass serviceClass) { + this.serviceClass = serviceClass; + } + + public boolean isRecordMaster() { + return recordMaster; + } + + public void setRecordMaster(boolean cdrMaster) { + this.recordMaster = cdrMaster; + } + + +} diff --git a/orkbasej/java/net/sf/oreka/persistent/User.java b/orkbasej/java/net/sf/oreka/persistent/User.java new file mode 100644 index 0000000..5d78760 --- /dev/null +++ b/orkbasej/java/net/sf/oreka/persistent/User.java @@ -0,0 +1,133 @@ +/* + * Oreka -- A media capture and retrieval platform + * + * Copyright (C) 2005, orecx LLC + * + * http://www.orecx.com + * + * This program is free software, distributed under the terms of + * the GNU General Public License. + * Please refer to http://www.gnu.org/copyleft/gpl.html + * + */ + +/** + * + */ +package net.sf.oreka.persistent; + +import javax.persistence.Entity; +import javax.persistence.GeneratorType; +import javax.persistence.Id; + +/** + * @hibernate.class + */ +@Entity +public class User { + + private int id; + private String password = ""; + private String firstname = ""; + private String lastname = ""; + private String email = ""; + + /** + * @hibernate.property + * not-null="true" + * @return Returns the email. + */ + public String getEmail() { + return email; + } + + + /** + * @param email The email to set. + */ + public void setEmail(String email) { + this.email = email; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the firstname. + */ + public String getFirstname() { + return firstname; + } + + + /** + * @param firstname The firstname to set. + */ + public void setFirstname(String firstname) { + this.firstname = firstname; + } + + + /** + * @hibernate.id + * generator-class="native" + * @return Returns the id. + */ + @Id(generate=GeneratorType.AUTO) + public int getId() { + return id; + } + + + /** + * @param id The id to set. + */ + @Id(generate=GeneratorType.AUTO) + public void setId(int id) { + this.id = id; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the lastname. + */ + public String getLastname() { + return lastname; + } + + + /** + * @param lastname The lastname to set. + */ + public void setLastname(String lastname) { + this.lastname = lastname; + } + + + /** + * @hibernate.property + * not-null="true" + * @return Returns the password. + */ + public String getPassword() { + return password; + } + + + /** + * @param password The password to set. + */ + public void setPassword(String password) { + this.password = password; + } + + + /** + * + */ + public User() { + } + +} -- cgit v1.2.3