001/*
002 *  Licensed to the Apache Software Foundation (ASF) under one
003 *  or more contributor license agreements.  See the NOTICE file
004 *  distributed with this work for additional information
005 *  regarding copyright ownership.  The ASF licenses this file
006 *  to you under the Apache License, Version 2.0 (the
007 *  "License"); you may not use this file except in compliance
008 *  with the License.  You may obtain a copy of the License at
009 *
010 *        http://www.apache.org/licenses/LICENSE-2.0
011 *
012 *  Unless required by applicable law or agreed to in writing,
013 *  software distributed under the License is distributed on an
014 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *  KIND, either express or implied.  See the License for the
016 *  specific language governing permissions and limitations
017 *  under the License.
018 */
019
020package org.apache.isis.objectstore.jdo.applib.service.settings;
021
022import javax.jdo.annotations.IdentityType;
023
024import org.apache.isis.applib.annotation.Named;
025import org.apache.isis.applib.services.settings.ApplicationSetting;
026import org.apache.isis.applib.services.settings.SettingType;
027import org.apache.isis.objectstore.jdo.applib.service.JdoColumnLength;
028
029@javax.jdo.annotations.PersistenceCapable(
030        identityType = IdentityType.APPLICATION,
031        table="IsisApplicationSetting")
032@javax.jdo.annotations.Queries({ 
033     @javax.jdo.annotations.Query(
034             name = "findByKey", language = "JDOQL", 
035             value = "SELECT "
036                     + "FROM org.apache.isis.objectstore.jdo.applib.service.settings.ApplicationSettingJdo "
037                     + "WHERE key == :key"),
038     @javax.jdo.annotations.Query(
039            name = "findAll", language = "JDOQL", 
040            value = "SELECT "
041                    + "FROM org.apache.isis.objectstore.jdo.applib.service.settings.ApplicationSettingJdo "
042                    + "ORDER BY key")
043})
044@Named("Application Setting")
045public class ApplicationSettingJdo extends SettingAbstractJdo implements ApplicationSetting {
046
047
048    @javax.jdo.annotations.Column(length=JdoColumnLength.SettingAbstract.SETTING_KEY)
049    @javax.jdo.annotations.PrimaryKey
050    public String getKey() {
051        return super.getKey();
052    }
053    @Override
054    public void setKey(String key) {
055        super.setKey(key);
056    }
057
058    // //////////////////////////////////////
059
060    @javax.jdo.annotations.Column(length=JdoColumnLength.DESCRIPTION)
061    @javax.jdo.annotations.Persistent
062    @Override
063    public String getDescription() {
064        return super.getDescription();
065    }
066    @Override
067    public void setDescription(String description) {
068        super.setDescription(description);
069    }
070    
071    // //////////////////////////////////////
072
073    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.SettingAbstract.VALUE_RAW)
074    @javax.jdo.annotations.Persistent
075    @Override
076    public String getValueRaw() {
077        return super.getValueRaw();
078    }
079    @Override
080    public void setValueRaw(String valueAsRaw) {
081        super.setValueRaw(valueAsRaw);
082    }
083    
084    // //////////////////////////////////////
085
086    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.SettingAbstract.SETTING_TYPE)
087    @javax.jdo.annotations.Persistent
088    @Override
089    public SettingType getType() {
090        return super.getType();
091    }
092    @Override
093    public void setType(SettingType type) {
094        super.setType(type);
095    }
096}