/**
* Abiquo community edition
* cloud management application for hybrid clouds
* Copyright (C) 2008-2010 - Abiquo Holdings S.L.
*
* This application is free software; you can redistribute it and/or
* modify it under the terms of the GNU LESSER GENERAL PUBLIC
* LICENSE as published by the Free Software Foundation under
* version 3 of the License
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* LESSER GENERAL PUBLIC LICENSE v.3 for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
package com.abiquo.server.core.config;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.validator.constraints.Length;
import com.abiquo.server.core.common.DefaultEntityBase;
import com.softwarementors.validation.constraints.LeadingOrTrailingWhitespace;
import com.softwarementors.validation.constraints.Required;
@Entity
@Table(name = SystemProperty.TABLE_NAME)
@org.hibernate.annotations.Table(appliesTo = SystemProperty.TABLE_NAME)
public class SystemProperty extends DefaultEntityBase
{
public static final String TABLE_NAME = "system_properties";
protected SystemProperty()
{
}
private final static String ID_COLUMN = "systemPropertyId";
@Id
@GeneratedValue
@Column(name = ID_COLUMN, nullable = false)
private Integer id;
public Integer getId()
{
return this.id;
}
public final static String NAME_PROPERTY = "name";
private final static boolean NAME_REQUIRED = true;
/* package */final static int NAME_LENGTH_MIN = 0;
/* package */final static int NAME_LENGTH_MAX = 255;
private final static boolean NAME_LEADING_OR_TRAILING_WHITESPACES_ALLOWED = false;
private final static String NAME_COLUMN = "name";
@Column(name = NAME_COLUMN, nullable = !NAME_REQUIRED, length = NAME_LENGTH_MAX)
private String name;
@Required(value = NAME_REQUIRED)
@Length(min = NAME_LENGTH_MIN, max = NAME_LENGTH_MAX)
@LeadingOrTrailingWhitespace(allowed = NAME_LEADING_OR_TRAILING_WHITESPACES_ALLOWED)
public String getName()
{
return this.name;
}
public void setName(String name)
{
this.name = name;
}
public final static String VALUE_PROPERTY = "value";
private final static boolean VALUE_REQUIRED = true;
/* package */final static int VALUE_LENGTH_MIN = 0;
/* package */final static int VALUE_LENGTH_MAX = 255;
private final static boolean VALUE_LEADING_OR_TRAILING_WHITESPACES_ALLOWED = false;
private final static String VALUE_COLUMN = "value";
@Column(name = VALUE_COLUMN, nullable = !VALUE_REQUIRED, length = VALUE_LENGTH_MAX)
private String value;
@Required(value = VALUE_REQUIRED)
@Length(min = VALUE_LENGTH_MIN, max = VALUE_LENGTH_MAX)
@LeadingOrTrailingWhitespace(allowed = VALUE_LEADING_OR_TRAILING_WHITESPACES_ALLOWED)
public String getValue()
{
return this.value;
}
public void setValue(String value)
{
this.value = value;
}
public final static String DESCRIPTION_PROPERTY = "description";
private final static boolean DESCRIPTION_REQUIRED = false;
private final static int DESCRIPTION_LENGTH_MIN = 0;
private final static int DESCRIPTION_LENGTH_MAX = 255;
private final static boolean DESCRIPTION_LEADING_OR_TRAILING_WHITESPACES_ALLOWED = false;
private final static String DESCRIPTION_COLUMN = "description";
@Column(name = DESCRIPTION_COLUMN, nullable = !DESCRIPTION_REQUIRED, length = DESCRIPTION_LENGTH_MAX)
private String description;
@Required(value = DESCRIPTION_REQUIRED)
@Length(min = DESCRIPTION_LENGTH_MIN, max = DESCRIPTION_LENGTH_MAX)
@LeadingOrTrailingWhitespace(allowed = DESCRIPTION_LEADING_OR_TRAILING_WHITESPACES_ALLOWED)
public String getDescription()
{
return this.description;
}
public void setDescription(String description)
{
this.description = description;
}
// *************************** Mandatory constructors ***********************
public SystemProperty(String name, String value)
{
super();
setName(name);
setValue(value);
}
}