Signed-off-by: Richard Marko <rma...@redhat.com> --- .../com/redhat/rhn/domain/server/Crashes.hbm.xml | 22 +++++ .../src/com/redhat/rhn/domain/server/Crashes.java | 102 ++++++++++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 java/code/src/com/redhat/rhn/domain/server/Crashes.hbm.xml create mode 100644 java/code/src/com/redhat/rhn/domain/server/Crashes.java
diff --git a/java/code/src/com/redhat/rhn/domain/server/Crashes.hbm.xml b/java/code/src/com/redhat/rhn/domain/server/Crashes.hbm.xml new file mode 100644 index 0000000..95a11f4 --- /dev/null +++ b/java/code/src/com/redhat/rhn/domain/server/Crashes.hbm.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE hibernate-mapping +PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" +"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> +<hibernate-mapping> + <class name="com.redhat.rhn.domain.server.Crashes" table="rhnAbrtInfo"> + <id name="id" type="long" column="id"> + <meta attribute="scope-set">protected</meta> + <generator class="sequence"> + <param name="sequence">rhn_abrt_info_id_seq</param> + </generator> + </id> + + <many-to-one name="server" + class="com.redhat.rhn.domain.server.Server" + column="server_id" /> + <property name="crashCount" column="num_crashes" type="long" /> + <property name="created" column="created" type="timestamp" + insert="false" update="false"/> + + </class> +</hibernate-mapping> diff --git a/java/code/src/com/redhat/rhn/domain/server/Crashes.java b/java/code/src/com/redhat/rhn/domain/server/Crashes.java new file mode 100644 index 0000000..5b1605d --- /dev/null +++ b/java/code/src/com/redhat/rhn/domain/server/Crashes.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) 2009--2010 Red Hat, Inc. + * + * This software is licensed to you under the GNU General Public License, + * version 2 (GPLv2). There is NO WARRANTY for this software, express or + * implied, including the implied warranties of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 + * along with this software; if not, see + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. + * + * Red Hat trademarks are not licensed under GPLv2. No permission is + * granted to use or replicate Red Hat trademarks that are incorporated + * in this software or its documentation. + */ +package com.redhat.rhn.domain.server; + +import com.redhat.rhn.domain.BaseDomainHelper; + +import java.util.Date; + +/** + * Represents the number of crashes on a particular server. + * @version $Rev$ + */ +public class Crashes extends BaseDomainHelper { + + private Long id; + private Server server; + private Date created; + private long crashCount; + + /** + * Represents application crash information. + */ + public Crashes() { + super(); + } + + /** + * Returns the database id of the crashes object. + * @return Returns the id. + */ + public Long getId() { + return id; + } + + /** + * Sets the database id of the crashes object. + * @param idIn The id to set. + */ + public void setId(Long idIn) { + id = idIn; + } + + /** + * Returns the date of the last update. + * @return the date of the last update. + */ + public Date getCreated() { + return created; + } + + /** + * Sets the date of the last update. + * @param lastmod Last modification date. + */ + public void setCreated(Date lastmod) { + created = lastmod; + } + + /** + * The parent server. + * @return Returns the server. + */ + public Server getServer() { + return server; + } + + /** + * Sets the parent server. + * @param serverIn The server to set. + */ + public void setServer(Server serverIn) { + server = serverIn; + } + + /** + * Returns the total number of application crashes. + * @return the total number of application crashes. + */ + public long getCrashCount() { + return crashCount; + } + + /** + * Sets the total number of application crashes. + * @param count The total number of crashes. + */ + public void setCrashCount(long count) { + crashCount = count; + } +} -- 1.7.10.4 _______________________________________________ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel