CLOUDSTACK-8592: creating respective VO objects

This commit is contained in:
Abhinandan Prateek 2015-07-07 09:14:41 +05:30 committed by Rohit Yadav
parent 2c37ddb48b
commit 6c4dea7bb8
5 changed files with 369 additions and 3 deletions

View File

@ -0,0 +1,133 @@
//Licensed to the Apache Software Foundation (ASF) under one
//or more contributor license agreements. See the NOTICE file
//distributed with this work for additional information
//regarding copyright ownership. The ASF licenses this file
//to you under the Apache License, Version 2.0 (the
//"License"); you may not use this file except in compliance
//with the License. You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing,
//software distributed under the License is distributed on an
//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
//KIND, either express or implied. See the License for the
//specific language governing permissions and limitations
//under the License.
package org.apache.cloudstack.quota;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.apache.cloudstack.api.InternalIdentity;
@Entity
@Table(name = "quota_balance")
public class QuotaBalanceVO implements InternalIdentity {
public QuotaBalanceVO(Long accountId, Long domainId,
BigDecimal creditBalance, Date updatedOn, Long previousUpdateId,
Date previousUpdateOn) {
super();
this.accountId = accountId;
this.domainId = domainId;
this.creditBalance = creditBalance;
this.updatedOn = updatedOn;
this.previousUpdateId = previousUpdateId;
this.previousUpdateOn = previousUpdateOn;
}
private static final long serialVersionUID = -7112846845287653210L;
@Id
@Column(name = "id")
private Long id;
@Column(name = "account_id")
private Long accountId = null;
@Column(name = "domain_id")
private Long domainId = null;
@Column(name = "credit_balance")
private BigDecimal creditBalance;
@Column(name = "updated_on")
@Temporal(value = TemporalType.TIMESTAMP)
private Date updatedOn = null;
@Column(name = "previous_update_id")
private Long previousUpdateId;
@Column(name = "previous_update_on")
@Temporal(value = TemporalType.TIMESTAMP)
private Date previousUpdateOn = null;
public QuotaBalanceVO() {
}
@Override
public long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getAccountId() {
return accountId;
}
public void setAccountId(Long accountId) {
this.accountId = accountId;
}
public Long getDomainId() {
return domainId;
}
public void setDomainId(Long domainId) {
this.domainId = domainId;
}
public BigDecimal getCreditBalance() {
return creditBalance;
}
public void setCreditBalance(BigDecimal creditBalance) {
this.creditBalance = creditBalance;
}
public Date getUpdatedOn() {
return updatedOn;
}
public void setUpdatedOn(Date updatedOn) {
this.updatedOn = updatedOn;
}
public Long getPreviousUpdateId() {
return previousUpdateId;
}
public void setPreviousUpdateId(Long previousUpdateId) {
this.previousUpdateId = previousUpdateId;
}
public Date getPreviousUpdateOn() {
return previousUpdateOn;
}
public void setPreviousUpdateOn(Date previousUpdateOn) {
this.previousUpdateOn = previousUpdateOn;
}
}

View File

@ -32,7 +32,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Table(name = "quota_credits")
public class QuotaCreditsVO implements InternalIdentity {
private static final long serialVersionUID = -7117933845287653210L;
private static final long serialVersionUID = -3576833845287653210L;
@Id
@Column(name = "id")

View File

@ -0,0 +1,114 @@
//Licensed to the Apache Software Foundation (ASF) under one
//or more contributor license agreements. See the NOTICE file
//distributed with this work for additional information
//regarding copyright ownership. The ASF licenses this file
//to you under the Apache License, Version 2.0 (the
//"License"); you may not use this file except in compliance
//with the License. You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing,
//software distributed under the License is distributed on an
//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
//KIND, either express or implied. See the License for the
//specific language governing permissions and limitations
//under the License.
package org.apache.cloudstack.quota;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.apache.cloudstack.api.InternalIdentity;
@Entity
@Table(name = "quota_email_templates")
public class QuotaEmailTemplatesVO implements InternalIdentity {
public QuotaEmailTemplatesVO(String templateName, String templateText,
String locale, Integer version) {
super();
this.templateName = templateName;
this.templateText = templateText;
this.locale = locale;
this.version = version;
}
private static final long serialVersionUID = -7117933842834553210L;
@Id
@Column(name = "id")
private Long id;
@Column(name = "template_name")
private String templateName;
@Column(name = "template_text")
private String templateText;
@Column(name = "last_updated")
@Temporal(value = TemporalType.TIMESTAMP)
private Date lastUpdated = null;
@Column(name = "locale")
private String locale;
@Column(name = "version")
private Integer version;
public QuotaEmailTemplatesVO() {
}
@Override
public long getId() {
// TODO Auto-generated method stub
return id;
}
public String getTemplateName() {
return templateName;
}
public void setTemplateName(String templateName) {
this.templateName = templateName;
}
public String getTemplateText() {
return templateText;
}
public void setTemplateText(String templateText) {
this.templateText = templateText;
}
public Date getLastUpdated() {
return lastUpdated;
}
public void setLastUpdated(Date lastUpdated) {
this.lastUpdated = lastUpdated;
}
public String getLocale() {
return locale;
}
public void setLocale(String locale) {
this.locale = locale;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
}

View File

@ -0,0 +1,121 @@
//Licensed to the Apache Software Foundation (ASF) under one
//or more contributor license agreements. See the NOTICE file
//distributed with this work for additional information
//regarding copyright ownership. The ASF licenses this file
//to you under the Apache License, Version 2.0 (the
//"License"); you may not use this file except in compliance
//with the License. You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing,
//software distributed under the License is distributed on an
//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
//KIND, either express or implied. See the License for the
//specific language governing permissions and limitations
//under the License.
package org.apache.cloudstack.quota;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.apache.cloudstack.api.InternalIdentity;
@Entity
@Table(name = "quota_usage")
public class QuotaUsageVO implements InternalIdentity {
private static final long serialVersionUID = -7117933845287204781L;
@Id
@Column(name = "id")
private Long id;
@Column(name = "usage_item_id")
private Long usageItemId;
@Column(name = "usage_type")
private String usageType;
@Column(name = "quota_used")
private BigDecimal quotaUsed;
@Column(name = "start_date")
@Temporal(value = TemporalType.TIMESTAMP)
private Date startDate = null;
@Column(name = "end_date")
@Temporal(value = TemporalType.TIMESTAMP)
private Date endDate = null;
public QuotaUsageVO() {
}
public QuotaUsageVO(Long usageItemId, String usageType,
BigDecimal quotaUsed, Date startDate, Date endDate) {
super();
this.usageItemId = usageItemId;
this.usageType = usageType;
this.quotaUsed = quotaUsed;
this.startDate = startDate;
this.endDate = endDate;
}
@Override
public long getId() {
// TODO Auto-generated method stub
return id;
}
public Long getUsageItemId() {
return usageItemId;
}
public void setUsageItemId(Long usageItemId) {
this.usageItemId = usageItemId;
}
public String getUsageType() {
return usageType;
}
public void setUsageType(String usageType) {
this.usageType = usageType;
}
public BigDecimal getQuotaUsed() {
return quotaUsed;
}
public void setQuotaUsed(BigDecimal quotaUsed) {
this.quotaUsed = quotaUsed;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public void setId(Long id) {
this.id = id;
}
}

View File

@ -114,10 +114,8 @@ CREATE TABLE `cloud_usage.quota_email_templates` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`template_name` varchar(64) DEFAULT NULL,
`template_text` longtext,
`category` int(10) unsigned NOT NULL DEFAULT '0',
`last_updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`locale` varchar(25) DEFAULT 'en_US',
`template_name_locale` varchar(74) DEFAULT NULL,
`version` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;