You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by hi...@apache.org on 2012/09/13 00:22:12 UTC

svn commit: r1384149 [2/3] - in /incubator/ambari/branches/AMBARI-666: ./ ambari-project/ ambari-server/ ambari-server/src/main/java/org/apache/ambari/server/orm/ ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ ambari-server/src/main/java...

Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ComponentHostDesiredStateEntity.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ComponentHostDesiredStateEntity.java?rev=1384149&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ComponentHostDesiredStateEntity.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ComponentHostDesiredStateEntity.java Wed Sep 12 22:22:10 2012
@@ -0,0 +1,153 @@
+/**
+ * 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.ambari.server.orm.entities;
+
+import javax.persistence.*;
+
+@javax.persistence.IdClass(ComponentHostDesiredStateEntityPK.class)
+@javax.persistence.Table(name = "componenthostdesiredstate", schema = "ambari", catalog = "")
+@Entity
+public class ComponentHostDesiredStateEntity {
+
+  private String clusterName = "";
+
+  @javax.persistence.Column(name = "cluster_name", insertable = false, updatable = false)
+  @Id
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  private String hostName = "";
+
+  @javax.persistence.Column(name = "host_name", nullable = false, insertable = false, updatable = false)
+  @Id
+  public String getHostName() {
+    return hostName;
+  }
+
+  public void setHostName(String hostName) {
+    this.hostName = hostName;
+  }
+
+  private String componentName = "";
+
+  @javax.persistence.Column(name = "component_name", nullable = false)
+  @Id
+  public String getComponentName() {
+    return componentName;
+  }
+
+  public void setComponentName(String componentName) {
+    this.componentName = componentName;
+  }
+
+  private String desiredState = "";
+
+  @javax.persistence.Column(name = "desired_state", nullable = false)
+  @Basic
+  public String getDesiredState() {
+    return desiredState;
+  }
+
+  public void setDesiredState(String desiredState) {
+    this.desiredState = desiredState;
+  }
+
+  private String desiredConfigVersion = "";
+
+  @javax.persistence.Column(name = "desired_config_version", nullable = false)
+  @Basic
+  public String getDesiredConfigVersion() {
+    return desiredConfigVersion;
+  }
+
+  public void setDesiredConfigVersion(String desiredConfigVersion) {
+    this.desiredConfigVersion = desiredConfigVersion;
+  }
+
+  private String desiredStackVersion = "";
+
+  @javax.persistence.Column(name = "desired_stack_version", nullable = false)
+  @Basic
+  public String getDesiredStackVersion() {
+    return desiredStackVersion;
+  }
+
+  public void setDesiredStackVersion(String desiredStackVersion) {
+    this.desiredStackVersion = desiredStackVersion;
+  }
+
+  private ClusterEntity clusterEntity;
+
+  @ManyToOne
+  @JoinColumn(name = "cluster_name")
+  public ClusterEntity getClusterEntity() {
+    return clusterEntity;
+  }
+
+  public void setClusterEntity(ClusterEntity clusterEntity) {
+    this.clusterEntity = clusterEntity;
+  }
+
+  private HostEntity hostEntity;
+
+  @ManyToOne
+  @JoinColumn(name = "host_name")
+  public HostEntity getHostEntity() {
+    return hostEntity;
+  }
+
+  public void setHostEntity(HostEntity hostEntity) {
+    this.hostEntity = hostEntity;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    ComponentHostDesiredStateEntity that = (ComponentHostDesiredStateEntity) o;
+
+    if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
+    if (componentName != null ? !componentName.equals(that.componentName) : that.componentName != null) return false;
+    if (desiredConfigVersion != null ? !desiredConfigVersion.equals(that.desiredConfigVersion) : that.desiredConfigVersion != null)
+      return false;
+    if (desiredStackVersion != null ? !desiredStackVersion.equals(that.desiredStackVersion) : that.desiredStackVersion != null)
+      return false;
+    if (desiredState != null ? !desiredState.equals(that.desiredState) : that.desiredState != null) return false;
+    if (hostName != null ? !hostName.equals(that.hostName) : that.hostName != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = clusterName != null ? clusterName.hashCode() : 0;
+    result = 31 * result + (hostName != null ? hostName.hashCode() : 0);
+    result = 31 * result + (componentName != null ? componentName.hashCode() : 0);
+    result = 31 * result + (desiredState != null ? desiredState.hashCode() : 0);
+    result = 31 * result + (desiredConfigVersion != null ? desiredConfigVersion.hashCode() : 0);
+    result = 31 * result + (desiredStackVersion != null ? desiredStackVersion.hashCode() : 0);
+    return result;
+  }
+}

Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ComponentHostDesiredStateEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ComponentHostDesiredStateEntityPK.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ComponentHostDesiredStateEntityPK.java?rev=1384149&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ComponentHostDesiredStateEntityPK.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ComponentHostDesiredStateEntityPK.java Wed Sep 12 22:22:10 2012
@@ -0,0 +1,84 @@
+/**
+ * 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.ambari.server.orm.entities;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class ComponentHostDesiredStateEntityPK implements Serializable {
+
+  private String clusterName;
+
+  @Id
+  @Column(name = "cluster_name")
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  private String hostName;
+
+  @Id
+  @Column(name = "host_name")
+  public String getHostName() {
+    return hostName;
+  }
+
+  public void setHostName(String hostName) {
+    this.hostName = hostName;
+  }
+
+  private String componentName;
+
+  @Id
+  @Column(name = "component_name")
+  public String getComponentName() {
+    return componentName;
+  }
+
+  public void setComponentName(String componentName) {
+    this.componentName = componentName;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    ComponentHostDesiredStateEntityPK that = (ComponentHostDesiredStateEntityPK) o;
+
+    if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
+    if (componentName != null ? !componentName.equals(that.componentName) : that.componentName != null) return false;
+    if (hostName != null ? !hostName.equals(that.hostName) : that.hostName != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = clusterName != null ? clusterName.hashCode() : 0;
+    result = 31 * result + (hostName != null ? hostName.hashCode() : 0);
+    result = 31 * result + (componentName != null ? componentName.hashCode() : 0);
+    return result;
+  }
+}

Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ComponentHostDesiredStateEntityPK.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentMappingEntity.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentMappingEntity.java?rev=1384149&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentMappingEntity.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentMappingEntity.java Wed Sep 12 22:22:10 2012
@@ -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.ambari.server.orm.entities;
+
+import javax.persistence.*;
+
+@IdClass(HostComponentMappingEntityPK.class)
+@Table(name = "hostcomponentmapping", schema = "ambari", catalog = "")
+@Entity
+public class HostComponentMappingEntity {
+
+  private String clusterName = "";
+
+  @Column(name = "cluster_name", insertable = false, updatable = false)
+  @Id
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  private String serviceName = "";
+
+  @Column(name = "service_name", nullable = false, insertable = false, updatable = false)
+  @Id
+  public String getServiceName() {
+    return serviceName;
+  }
+
+  public void setServiceName(String serviceName) {
+    this.serviceName = serviceName;
+  }
+
+  private Integer hostComponentMappingId;
+
+  @Column(name = "host_component_mapping_id")
+  @Id
+  @GeneratedValue(strategy = GenerationType.AUTO)
+  public Integer getHostComponentMappingId() {
+    return hostComponentMappingId;
+  }
+
+  public void setHostComponentMappingId(Integer hostComponentMappingId) {
+    this.hostComponentMappingId = hostComponentMappingId;
+  }
+
+  private String hostComponentMappingSnapshot;
+
+  @Column(name = "host_component_mapping_snapshot")
+  @Basic
+  public String getHostComponentMappingSnapshot() {
+    return hostComponentMappingSnapshot;
+  }
+
+  public void setHostComponentMappingSnapshot(String hostComponentMappingSnapshot) {
+    this.hostComponentMappingSnapshot = hostComponentMappingSnapshot;
+  }
+
+  ClusterServiceEntity clusterServiceEntity;
+
+  @ManyToOne
+  @JoinColumns(value = {@JoinColumn(name = "cluster_name", referencedColumnName = "cluster_name"), @JoinColumn(name = "service_name", referencedColumnName = "service_name")})
+  public ClusterServiceEntity getClusterServiceEntity() {
+    return clusterServiceEntity;
+  }
+
+  public void setClusterServiceEntity(ClusterServiceEntity clusterServiceEntity) {
+    this.clusterServiceEntity = clusterServiceEntity;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    HostComponentMappingEntity that = (HostComponentMappingEntity) o;
+
+    if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
+    if (hostComponentMappingId != null ? !hostComponentMappingId.equals(that.hostComponentMappingId) : that.hostComponentMappingId != null)
+      return false;
+    if (hostComponentMappingSnapshot != null ? !hostComponentMappingSnapshot.equals(that.hostComponentMappingSnapshot) : that.hostComponentMappingSnapshot != null)
+      return false;
+    if (serviceName != null ? !serviceName.equals(that.serviceName) : that.serviceName != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = clusterName != null ? clusterName.hashCode() : 0;
+    result = 31 * result + (serviceName != null ? serviceName.hashCode() : 0);
+    result = 31 * result + (hostComponentMappingId != null ? hostComponentMappingId.hashCode() : 0);
+    result = 31 * result + (hostComponentMappingSnapshot != null ? hostComponentMappingSnapshot.hashCode() : 0);
+    return result;
+  }
+}

Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentMappingEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentMappingEntityPK.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentMappingEntityPK.java?rev=1384149&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentMappingEntityPK.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentMappingEntityPK.java Wed Sep 12 22:22:10 2012
@@ -0,0 +1,85 @@
+/**
+ * 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.ambari.server.orm.entities;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class HostComponentMappingEntityPK implements Serializable {
+
+  private String clusterName;
+
+  @Id
+  @Column(name = "cluster_name")
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  private String serviceName;
+
+  @Id
+  @Column(name = "service_name")
+  public String getServiceName() {
+    return serviceName;
+  }
+
+  public void setServiceName(String serviceName) {
+    this.serviceName = serviceName;
+  }
+
+  private Integer hostComponentMappingId;
+
+  @Id
+  @Column(name = "host_component_mapping_id")
+  public Integer getHostComponentMappingId() {
+    return hostComponentMappingId;
+  }
+
+  public void setHostComponentMappingId(Integer hostComponentMappingId) {
+    this.hostComponentMappingId = hostComponentMappingId;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    HostComponentMappingEntityPK that = (HostComponentMappingEntityPK) o;
+
+    if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
+    if (hostComponentMappingId != null ? !hostComponentMappingId.equals(that.hostComponentMappingId) : that.hostComponentMappingId != null)
+      return false;
+    if (serviceName != null ? !serviceName.equals(that.serviceName) : that.serviceName != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = clusterName != null ? clusterName.hashCode() : 0;
+    result = 31 * result + (serviceName != null ? serviceName.hashCode() : 0);
+    result = 31 * result + (hostComponentMappingId != null ? hostComponentMappingId.hashCode() : 0);
+    return result;
+  }
+}

Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentMappingEntityPK.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java?rev=1384149&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java Wed Sep 12 22:22:10 2012
@@ -0,0 +1,153 @@
+/**
+ * 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.ambari.server.orm.entities;
+
+import javax.persistence.*;
+
+@javax.persistence.IdClass(HostComponentStateEntityPK.class)
+@javax.persistence.Table(name = "hostcomponentstate", schema = "ambari", catalog = "")
+@Entity
+public class HostComponentStateEntity {
+
+  private String clusterName;
+
+  @javax.persistence.Column(name = "cluster_name", insertable = false, updatable = false)
+  @Id
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  private String hostName;
+
+  @javax.persistence.Column(name = "host_name", insertable = false, updatable = false)
+  @Id
+  public String getHostName() {
+    return hostName;
+  }
+
+  public void setHostName(String hostName) {
+    this.hostName = hostName;
+  }
+
+  private String componentName;
+
+  @javax.persistence.Column(name = "component_name")
+  @Id
+  public String getComponentName() {
+    return componentName;
+  }
+
+  public void setComponentName(String componentName) {
+    this.componentName = componentName;
+  }
+
+  private String currentState;
+
+  @javax.persistence.Column(name = "current_state")
+  @Basic
+  public String getCurrentState() {
+    return currentState;
+  }
+
+  public void setCurrentState(String currentState) {
+    this.currentState = currentState;
+  }
+
+  private String currentConfigVersion;
+
+  @javax.persistence.Column(name = "current_config_version")
+  @Basic
+  public String getCurrentConfigVersion() {
+    return currentConfigVersion;
+  }
+
+  public void setCurrentConfigVersion(String currentConfigVersion) {
+    this.currentConfigVersion = currentConfigVersion;
+  }
+
+  private String currentStackVersion;
+
+  @javax.persistence.Column(name = "current_stack_version")
+  @Basic
+  public String getCurrentStackVersion() {
+    return currentStackVersion;
+  }
+
+  public void setCurrentStackVersion(String currentStackVersion) {
+    this.currentStackVersion = currentStackVersion;
+  }
+
+  private ClusterEntity clusterEntity;
+
+  @ManyToOne
+  @JoinColumn(name = "cluster_name")
+  public ClusterEntity getClusterEntity() {
+    return clusterEntity;
+  }
+
+  public void setClusterEntity(ClusterEntity clusterEntity) {
+    this.clusterEntity = clusterEntity;
+  }
+
+  private HostEntity hostEntity;
+
+  @ManyToOne
+  @JoinColumn(name = "host_name")
+  public HostEntity getHostEntity() {
+    return hostEntity;
+  }
+
+  public void setHostEntity(HostEntity hostEntity) {
+    this.hostEntity = hostEntity;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    HostComponentStateEntity that = (HostComponentStateEntity) o;
+
+    if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
+    if (componentName != null ? !componentName.equals(that.componentName) : that.componentName != null) return false;
+    if (currentConfigVersion != null ? !currentConfigVersion.equals(that.currentConfigVersion) : that.currentConfigVersion != null)
+      return false;
+    if (currentStackVersion != null ? !currentStackVersion.equals(that.currentStackVersion) : that.currentStackVersion != null)
+      return false;
+    if (currentState != null ? !currentState.equals(that.currentState) : that.currentState != null) return false;
+    if (hostName != null ? !hostName.equals(that.hostName) : that.hostName != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = clusterName != null ? clusterName.hashCode() : 0;
+    result = 31 * result + (hostName != null ? hostName.hashCode() : 0);
+    result = 31 * result + (componentName != null ? componentName.hashCode() : 0);
+    result = 31 * result + (currentState != null ? currentState.hashCode() : 0);
+    result = 31 * result + (currentConfigVersion != null ? currentConfigVersion.hashCode() : 0);
+    result = 31 * result + (currentStackVersion != null ? currentStackVersion.hashCode() : 0);
+    return result;
+  }
+}

Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntityPK.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntityPK.java?rev=1384149&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntityPK.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntityPK.java Wed Sep 12 22:22:10 2012
@@ -0,0 +1,84 @@
+/**
+ * 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.ambari.server.orm.entities;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class HostComponentStateEntityPK implements Serializable {
+
+  private String clusterName;
+
+  @Id
+  @Column(name = "cluster_name")
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  private String hostName;
+
+  @Id
+  @Column(name = "host_name")
+  public String getHostName() {
+    return hostName;
+  }
+
+  public void setHostName(String hostName) {
+    this.hostName = hostName;
+  }
+
+  private String componentName;
+
+  @Id
+  @Column(name = "component_name")
+  public String getComponentName() {
+    return componentName;
+  }
+
+  public void setComponentName(String componentName) {
+    this.componentName = componentName;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    HostComponentStateEntityPK that = (HostComponentStateEntityPK) o;
+
+    if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
+    if (componentName != null ? !componentName.equals(that.componentName) : that.componentName != null) return false;
+    if (hostName != null ? !hostName.equals(that.hostName) : that.hostName != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = clusterName != null ? clusterName.hashCode() : 0;
+    result = 31 * result + (hostName != null ? hostName.hashCode() : 0);
+    result = 31 * result + (componentName != null ? componentName.hashCode() : 0);
+    return result;
+  }
+}

Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntityPK.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostEntity.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostEntity.java?rev=1384149&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostEntity.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostEntity.java Wed Sep 12 22:22:10 2012
@@ -0,0 +1,331 @@
+/**
+ * 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.ambari.server.orm.entities;
+
+import javax.persistence.*;
+import java.util.List;
+
+@Table(name = "hosts", schema = "ambari", catalog = "")
+@Entity
+public class HostEntity {
+
+  private String clusterName;
+
+  @Column(name = "cluster_name", insertable = false, updatable = false)
+  @Basic
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  private String hostName;
+
+  @Column(name = "host_name", nullable = false)
+  @Id
+  public String getHostName() {
+    return hostName;
+  }
+
+  public void setHostName(String hostName) {
+    this.hostName = hostName;
+  }
+
+  private String ip;
+
+  @Column(name = "ip", unique = true, nullable = false)
+  @Basic
+  public String getIp() {
+    return ip;
+  }
+
+  public void setIp(String ip) {
+    this.ip = ip;
+  }
+
+  private Integer totalMem = 0;
+
+  @Column(name = "total_mem", nullable = false)
+  @Basic
+  public Integer getTotalMem() {
+    return totalMem;
+  }
+
+  public void setTotalMem(Integer totalMem) {
+    this.totalMem = totalMem;
+  }
+
+  private Integer cpuCount = 0;
+
+  @Column(name = "cpu_count", nullable = false)
+  @Basic
+  public Integer getCpuCount() {
+    return cpuCount;
+  }
+
+  public void setCpuCount(Integer cpuCount) {
+    this.cpuCount = cpuCount;
+  }
+
+  private String cpuInfo = "";
+
+  @Column(name = "cpu_info", nullable = false)
+  @Basic
+  public String getCpuInfo() {
+    return cpuInfo;
+  }
+
+  public void setCpuInfo(String cpuInfo) {
+    this.cpuInfo = cpuInfo;
+  }
+
+  private String osArch = "";
+
+  @Column(name = "os_arch", nullable = false)
+  @Basic
+  public String getOsArch() {
+    return osArch;
+  }
+
+  public void setOsArch(String osArch) {
+    this.osArch = osArch;
+  }
+
+  private String disksInfo = "";
+
+  @Column(name = "disks_info", nullable = false)
+  @Basic
+  public String getDisksInfo() {
+    return disksInfo;
+  }
+
+  public void setDisksInfo(String disksInfo) {
+    this.disksInfo = disksInfo;
+  }
+
+  private String osInfo = "";
+
+  @Column(name = "os_info", nullable = false)
+  @Basic
+  public String getOsInfo() {
+    return osInfo;
+  }
+
+  public void setOsInfo(String osInfo) {
+    this.osInfo = osInfo;
+  }
+
+  private String osType = "";
+
+  @Column(name = "os_type", nullable = false)
+  @Basic
+  public String getOsType() {
+    return osType;
+  }
+
+  public void setOsType(String osType) {
+    this.osType = osType;
+  }
+
+  private String discoveryStatus = "";
+
+  @Column(name = "discovery_status", nullable = false)
+  @Basic
+  public String getDiscoveryStatus() {
+    return discoveryStatus;
+  }
+
+  public void setDiscoveryStatus(String discoveryStatus) {
+    this.discoveryStatus = discoveryStatus;
+  }
+
+  private Integer lastRegistrationTime = 0;
+
+  @Column(name = "last_registration_time", nullable = false)
+  @Basic
+  public Integer getLastRegistrationTime() {
+    return lastRegistrationTime;
+  }
+
+  public void setLastRegistrationTime(Integer lastRegistrationTime) {
+    this.lastRegistrationTime = lastRegistrationTime;
+  }
+
+  private String rackInfo = "/default-rack";
+
+  @Column(name = "rack_info", nullable = false)
+  @Basic
+  public String getRackInfo() {
+    return rackInfo;
+  }
+
+  public void setRackInfo(String rackInfo) {
+    this.rackInfo = rackInfo;
+  }
+
+  private String hostAttributes = "";
+
+  @Column(name = "host_attributes", nullable = false)
+  @Basic
+  public String getHostAttributes() {
+    return hostAttributes;
+  }
+
+  public void setHostAttributes(String hostAttributes) {
+    this.hostAttributes = hostAttributes;
+  }
+
+  private ClusterEntity clusterEntity;
+
+  @ManyToOne
+  @JoinColumn(name = "cluster_name")
+  public ClusterEntity getClusterEntity() {
+    return clusterEntity;
+  }
+
+  public void setClusterEntity(ClusterEntity clusterEntity) {
+    this.clusterEntity = clusterEntity;
+  }
+
+  private HostStateEntity hostStateEntity;
+
+  @OneToOne(cascade = CascadeType.ALL, mappedBy = "hostEntity")
+  public HostStateEntity getHostStateEntity() {
+    return hostStateEntity;
+  }
+
+  public void setHostStateEntity(HostStateEntity hostStateEntity) {
+    this.hostStateEntity = hostStateEntity;
+  }
+
+  private List<ActionStatusEntity> actionStatusEntity;
+
+  @OneToMany(mappedBy = "hostEntity")
+  public List<ActionStatusEntity> getActionStatusEntity() {
+    return actionStatusEntity;
+  }
+
+  public void setActionStatusEntity(List<ActionStatusEntity> actionStatusEntity) {
+    this.actionStatusEntity = actionStatusEntity;
+  }
+
+  private List<ServiceComponentHostConfigEntity> serviceComponentHostConfigEntities;
+
+  @OneToMany(mappedBy = "hostEntity")
+  public List<ServiceComponentHostConfigEntity> getServiceComponentHostConfigEntities() {
+    return serviceComponentHostConfigEntities;
+  }
+
+  public void setServiceComponentHostConfigEntities(List<ServiceComponentHostConfigEntity> serviceComponentHostConfigEntities) {
+    this.serviceComponentHostConfigEntities = serviceComponentHostConfigEntities;
+  }
+
+  private List<ComponentHostDesiredStateEntity> componentHostDesiredStateEntities;
+
+  @OneToMany(mappedBy = "hostEntity")
+  public List<ComponentHostDesiredStateEntity> getComponentHostDesiredStateEntities() {
+    return componentHostDesiredStateEntities;
+  }
+
+  public void setComponentHostDesiredStateEntities(List<ComponentHostDesiredStateEntity> componentHostDesiredStateEntities) {
+    this.componentHostDesiredStateEntities = componentHostDesiredStateEntities;
+  }
+
+  private List<HostComponentStateEntity> hostComponentStateEntities;
+
+  @OneToMany(mappedBy = "hostEntity")
+  public List<HostComponentStateEntity> getHostComponentStateEntities() {
+    return hostComponentStateEntities;
+  }
+
+  public void setHostComponentStateEntities(List<HostComponentStateEntity> hostComponentStateEntities) {
+    this.hostComponentStateEntities = hostComponentStateEntities;
+  }
+
+  private List<ServiceStateEntity> serviceStateEntities;
+
+  @OneToMany(mappedBy = "hostEntity")
+  public List<ServiceStateEntity> getServiceStateEntities() {
+    return serviceStateEntities;
+  }
+
+  public void setServiceStateEntities(List<ServiceStateEntity> serviceStateEntities) {
+    this.serviceStateEntities = serviceStateEntities;
+  }
+
+  private List<ServiceComponentStateEntity> serviceComponentStateEntities;
+
+  @OneToMany(mappedBy = "hostEntity")
+  public List<ServiceComponentStateEntity> getServiceComponentStateEntities() {
+    return serviceComponentStateEntities;
+  }
+
+  public void setServiceComponentStateEntities(List<ServiceComponentStateEntity> serviceComponentStateEntities) {
+    this.serviceComponentStateEntities = serviceComponentStateEntities;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    HostEntity that = (HostEntity) o;
+
+    if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
+    if (cpuCount != null ? !cpuCount.equals(that.cpuCount) : that.cpuCount != null) return false;
+    if (cpuInfo != null ? !cpuInfo.equals(that.cpuInfo) : that.cpuInfo != null) return false;
+    if (discoveryStatus != null ? !discoveryStatus.equals(that.discoveryStatus) : that.discoveryStatus != null)
+      return false;
+    if (disksInfo != null ? !disksInfo.equals(that.disksInfo) : that.disksInfo != null) return false;
+    if (hostAttributes != null ? !hostAttributes.equals(that.hostAttributes) : that.hostAttributes != null)
+      return false;
+    if (hostName != null ? !hostName.equals(that.hostName) : that.hostName != null) return false;
+    if (ip != null ? !ip.equals(that.ip) : that.ip != null) return false;
+    if (lastRegistrationTime != null ? !lastRegistrationTime.equals(that.lastRegistrationTime) : that.lastRegistrationTime != null)
+      return false;
+    if (osArch != null ? !osArch.equals(that.osArch) : that.osArch != null) return false;
+    if (osInfo != null ? !osInfo.equals(that.osInfo) : that.osInfo != null) return false;
+    if (osType != null ? !osType.equals(that.osType) : that.osType != null) return false;
+    if (rackInfo != null ? !rackInfo.equals(that.rackInfo) : that.rackInfo != null) return false;
+    if (totalMem != null ? !totalMem.equals(that.totalMem) : that.totalMem != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = clusterName != null ? clusterName.hashCode() : 0;
+    result = 31 * result + (hostName != null ? hostName.hashCode() : 0);
+    result = 31 * result + (ip != null ? ip.hashCode() : 0);
+    result = 31 * result + (totalMem != null ? totalMem.hashCode() : 0);
+    result = 31 * result + (cpuCount != null ? cpuCount.hashCode() : 0);
+    result = 31 * result + (cpuInfo != null ? cpuInfo.hashCode() : 0);
+    result = 31 * result + (osArch != null ? osArch.hashCode() : 0);
+    result = 31 * result + (disksInfo != null ? disksInfo.hashCode() : 0);
+    result = 31 * result + (osInfo != null ? osInfo.hashCode() : 0);
+    result = 31 * result + (osType != null ? osType.hashCode() : 0);
+    result = 31 * result + (discoveryStatus != null ? discoveryStatus.hashCode() : 0);
+    result = 31 * result + (lastRegistrationTime != null ? lastRegistrationTime.hashCode() : 0);
+    result = 31 * result + (rackInfo != null ? rackInfo.hashCode() : 0);
+    result = 31 * result + (hostAttributes != null ? hostAttributes.hashCode() : 0);
+    return result;
+  }
+}

Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostStateEntity.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostStateEntity.java?rev=1384149&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostStateEntity.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostStateEntity.java Wed Sep 12 22:22:10 2012
@@ -0,0 +1,137 @@
+/**
+ * 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.ambari.server.orm.entities;
+
+import javax.persistence.*;
+
+@Table(name = "hoststate", schema = "ambari", catalog = "")
+@Entity
+public class HostStateEntity {
+
+  private String clusterName;
+
+  @Column(name = "cluster_name", insertable = false, updatable = false)
+  @Basic
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  private String hostName;
+
+  @Column(name = "host_name", insertable = false, updatable = false)
+  @Id
+  public String getHostName() {
+    return hostName;
+  }
+
+  public void setHostName(String hostName) {
+    this.hostName = hostName;
+  }
+
+  private Integer lastHeartbeatTime = 0;
+
+  @Column(name = "last_heartbeat_time")
+  @Basic
+  public Integer getLastHeartbeatTime() {
+    return lastHeartbeatTime;
+  }
+
+  public void setLastHeartbeatTime(Integer lastHeartbeatTime) {
+    this.lastHeartbeatTime = lastHeartbeatTime;
+  }
+
+  private String agentVersion = "";
+
+  @Column(name = "agent_version")
+  @Basic
+  public String getAgentVersion() {
+    return agentVersion;
+  }
+
+  public void setAgentVersion(String agentVersion) {
+    this.agentVersion = agentVersion;
+  }
+
+  private String currentState;
+
+  @Column(name = "current_state")
+  @Basic
+  public String getCurrentState() {
+    return currentState;
+  }
+
+  public void setCurrentState(String currentState) {
+    this.currentState = currentState;
+  }
+
+  private HostEntity hostEntity;
+
+  @OneToOne
+  @JoinColumn(name = "host_name")
+  public HostEntity getHostEntity() {
+    return hostEntity;
+  }
+
+  public void setHostEntity(HostEntity hostEntity) {
+    this.hostEntity = hostEntity;
+  }
+
+  private ClusterEntity clusterEntity;
+
+  @ManyToOne
+  @JoinColumn(name = "cluster_name")
+  public ClusterEntity getClusterEntity() {
+    return clusterEntity;
+  }
+
+  public void setClusterEntity(ClusterEntity clusterEntity) {
+    this.clusterEntity = clusterEntity;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    HostStateEntity that = (HostStateEntity) o;
+
+    if (agentVersion != null ? !agentVersion.equals(that.agentVersion) : that.agentVersion != null) return false;
+    if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
+    if (currentState != null ? !currentState.equals(that.currentState) : that.currentState != null) return false;
+    if (hostName != null ? !hostName.equals(that.hostName) : that.hostName != null) return false;
+    if (lastHeartbeatTime != null ? !lastHeartbeatTime.equals(that.lastHeartbeatTime) : that.lastHeartbeatTime != null)
+      return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = clusterName != null ? clusterName.hashCode() : 0;
+    result = 31 * result + (hostName != null ? hostName.hashCode() : 0);
+    result = 31 * result + (lastHeartbeatTime != null ? lastHeartbeatTime.hashCode() : 0);
+    result = 31 * result + (agentVersion != null ? agentVersion.hashCode() : 0);
+    result = 31 * result + (currentState != null ? currentState.hashCode() : 0);
+    return result;
+  }
+}

Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostStateEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentConfigEntity.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentConfigEntity.java?rev=1384149&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentConfigEntity.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentConfigEntity.java Wed Sep 12 22:22:10 2012
@@ -0,0 +1,139 @@
+/**
+ * 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.ambari.server.orm.entities;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Table(name = "servicecomponentconfig", schema = "ambari", catalog = "")
+@Entity
+public class ServiceComponentConfigEntity {
+
+  private Integer configVersion;
+
+  @Column(name = "config_version")
+  @Id
+  @GeneratedValue(strategy = GenerationType.AUTO)
+  public Integer getConfigVersion() {
+    return configVersion;
+  }
+
+  public void setConfigVersion(Integer configVersion) {
+    this.configVersion = configVersion;
+  }
+
+  private String clusterName;
+
+  @Column(name = "cluster_name", nullable = false, insertable = false, updatable = false)
+  @Basic
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  private String serviceName;
+
+  @Column(name = "service_name", nullable = false, insertable = false, updatable = false)
+  @Basic
+  public String getServiceName() {
+    return serviceName;
+  }
+
+  public void setServiceName(String serviceName) {
+    this.serviceName = serviceName;
+  }
+
+  private String componentName;
+
+  @Column(name = "component_name", nullable = false)
+  @Basic
+  public String getComponentName() {
+    return componentName;
+  }
+
+  public void setComponentName(String componentName) {
+    this.componentName = componentName;
+  }
+
+  private String configSnapshot= "";
+
+  @Column(name = "config_snapshot", nullable = false)
+  @Basic
+  public String getConfigSnapshot() {
+    return configSnapshot;
+  }
+
+  public void setConfigSnapshot(String configSnapshot) {
+    this.configSnapshot = configSnapshot;
+  }
+
+  private Date configSnapshotTime;
+
+  @Column(name = "config_snapshot_time", nullable = false)
+  @Temporal(TemporalType.TIMESTAMP)
+  public Date getConfigSnapshotTime() {
+    return configSnapshotTime;
+  }
+
+  public void setConfigSnapshotTime(Date configSnapshotTime) {
+    this.configSnapshotTime = configSnapshotTime;
+  }
+
+  ClusterServiceEntity clusterServiceEntity;
+
+  @ManyToOne
+  @JoinColumns(value = {@JoinColumn(name = "cluster_name", referencedColumnName = "cluster_name"), @JoinColumn(name = "service_name", referencedColumnName = "service_name")})
+  public ClusterServiceEntity getClusterServiceEntity() {
+    return clusterServiceEntity;
+  }
+
+  public void setClusterServiceEntity(ClusterServiceEntity clusterServiceEntity) {
+    this.clusterServiceEntity = clusterServiceEntity;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    ServiceComponentConfigEntity that = (ServiceComponentConfigEntity) o;
+
+    if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
+    if (componentName != null ? !componentName.equals(that.componentName) : that.componentName != null) return false;
+    if (configSnapshot != null ? !configSnapshot.equals(that.configSnapshot) : that.configSnapshot != null)
+      return false;
+    if (configVersion != null ? !configVersion.equals(that.configVersion) : that.configVersion != null) return false;
+    if (serviceName != null ? !serviceName.equals(that.serviceName) : that.serviceName != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = configVersion != null ? configVersion.hashCode() : 0;
+    result = 31 * result + (clusterName != null ? clusterName.hashCode() : 0);
+    result = 31 * result + (serviceName != null ? serviceName.hashCode() : 0);
+    result = 31 * result + (componentName != null ? componentName.hashCode() : 0);
+    result = 31 * result + (configSnapshot != null ? configSnapshot.hashCode() : 0);
+    return result;
+  }
+}

Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentConfigEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentHostConfigEntity.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentHostConfigEntity.java?rev=1384149&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentHostConfigEntity.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentHostConfigEntity.java Wed Sep 12 22:22:10 2012
@@ -0,0 +1,165 @@
+/**
+ * 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.ambari.server.orm.entities;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Table(name = "servicecomponenthostconfig", schema = "ambari", catalog = "")
+@Entity
+public class ServiceComponentHostConfigEntity {
+
+  private Integer configVersion;
+
+  @Column(name = "config_version")
+  @Id
+  @GeneratedValue(strategy = GenerationType.AUTO)
+  public Integer getConfigVersion() {
+    return configVersion;
+  }
+
+  public void setConfigVersion(Integer configVersion) {
+    this.configVersion = configVersion;
+  }
+
+  private String clusterName;
+
+  @Column(name = "cluster_name", nullable = false, insertable = false, updatable = false)
+  @Basic
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  private String serviceName;
+
+  @Column(name = "service_name", nullable = false, insertable = false, updatable = false)
+  @Basic
+  public String getServiceName() {
+    return serviceName;
+  }
+
+  public void setServiceName(String serviceName) {
+    this.serviceName = serviceName;
+  }
+
+  private String componentName;
+
+  @Column(name = "component_name", nullable = false)
+  @Basic
+  public String getComponentName() {
+    return componentName;
+  }
+
+  public void setComponentName(String componentName) {
+    this.componentName = componentName;
+  }
+
+  private String hostName;
+
+  @Column(name = "host_name", nullable = false, insertable = false, updatable = false)
+  @Basic
+  public String getHostName() {
+    return hostName;
+  }
+
+  public void setHostName(String hostName) {
+    this.hostName = hostName;
+  }
+
+  private String configSnapshot = "";
+
+  @Column(name = "config_snapshot", nullable = false)
+  @Basic
+  public String getConfigSnapshot() {
+    return configSnapshot;
+  }
+
+  public void setConfigSnapshot(String configSnapshot) {
+    this.configSnapshot = configSnapshot;
+  }
+
+  private Date configSnapshotTime;
+
+  @Column(name = "config_snapshot_time", nullable = false)
+  @Temporal(TemporalType.TIMESTAMP)
+  public Date getConfigSnapshotTime() {
+    return configSnapshotTime;
+  }
+
+  public void setConfigSnapshotTime(Date configSnapshotTime) {
+    this.configSnapshotTime = configSnapshotTime;
+  }
+
+  private ClusterServiceEntity clusterServiceEntity;
+
+  @ManyToOne
+  @JoinColumns(value = {@JoinColumn(name = "cluster_name", referencedColumnName = "cluster_name"), @JoinColumn(name = "service_name", referencedColumnName = "service_name")})
+  public ClusterServiceEntity getClusterServiceEntity() {
+    return clusterServiceEntity;
+  }
+
+  public void setClusterServiceEntity(ClusterServiceEntity clusterServiceEntity) {
+    this.clusterServiceEntity = clusterServiceEntity;
+  }
+
+  private HostEntity hostEntity;
+
+  @ManyToOne
+  @JoinColumn(name = "host_name")
+  public HostEntity getHostEntity() {
+    return hostEntity;
+  }
+
+  public void setHostEntity(HostEntity hostEntity) {
+    this.hostEntity = hostEntity;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    ServiceComponentHostConfigEntity that = (ServiceComponentHostConfigEntity) o;
+
+    if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
+    if (componentName != null ? !componentName.equals(that.componentName) : that.componentName != null) return false;
+    if (configSnapshot != null ? !configSnapshot.equals(that.configSnapshot) : that.configSnapshot != null)
+      return false;
+    if (configVersion != null ? !configVersion.equals(that.configVersion) : that.configVersion != null) return false;
+    if (hostName != null ? !hostName.equals(that.hostName) : that.hostName != null) return false;
+    if (serviceName != null ? !serviceName.equals(that.serviceName) : that.serviceName != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = configVersion != null ? configVersion.hashCode() : 0;
+    result = 31 * result + (clusterName != null ? clusterName.hashCode() : 0);
+    result = 31 * result + (serviceName != null ? serviceName.hashCode() : 0);
+    result = 31 * result + (componentName != null ? componentName.hashCode() : 0);
+    result = 31 * result + (hostName != null ? hostName.hashCode() : 0);
+    result = 31 * result + (configSnapshot != null ? configSnapshot.hashCode() : 0);
+    return result;
+  }
+}

Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentHostConfigEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentStateEntity.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentStateEntity.java?rev=1384149&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentStateEntity.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentStateEntity.java Wed Sep 12 22:22:10 2012
@@ -0,0 +1,123 @@
+/**
+ * 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.ambari.server.orm.entities;
+
+import javax.persistence.*;
+
+@javax.persistence.IdClass(ServiceComponentStateEntityPK.class)
+@javax.persistence.Table(name = "servicecomponentstate", schema = "ambari", catalog = "")
+@Entity
+public class ServiceComponentStateEntity {
+
+  private String clusterName;
+
+  @javax.persistence.Column(name = "cluster_name", insertable = false, updatable = false)
+  @Id
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  private String hostName;
+
+  @javax.persistence.Column(name = "host_name", insertable = false, updatable = false)
+  @Id
+  public String getHostName() {
+    return hostName;
+  }
+
+  public void setHostName(String hostName) {
+    this.hostName = hostName;
+  }
+
+  private String componentName;
+
+  @javax.persistence.Column(name = "component_name")
+  @Id
+  public String getComponentName() {
+    return componentName;
+  }
+
+  public void setComponentName(String componentName) {
+    this.componentName = componentName;
+  }
+
+  private String currentState;
+
+  @javax.persistence.Column(name = "current_state")
+  @Basic
+  public String getCurrentState() {
+    return currentState;
+  }
+
+  public void setCurrentState(String currentState) {
+    this.currentState = currentState;
+  }
+
+  private ClusterEntity clusterEntity;
+
+  @ManyToOne
+  @JoinColumn(name = "cluster_name")
+  public ClusterEntity getClusterEntity() {
+    return clusterEntity;
+  }
+
+  public void setClusterEntity(ClusterEntity clusterEntity) {
+    this.clusterEntity = clusterEntity;
+  }
+
+  private HostEntity hostEntity;
+
+  @ManyToOne
+  @JoinColumn(name = "host_name")
+  public HostEntity getHostEntity() {
+    return hostEntity;
+  }
+
+  public void setHostEntity(HostEntity hostEntity) {
+    this.hostEntity = hostEntity;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    ServiceComponentStateEntity that = (ServiceComponentStateEntity) o;
+
+    if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
+    if (componentName != null ? !componentName.equals(that.componentName) : that.componentName != null) return false;
+    if (currentState != null ? !currentState.equals(that.currentState) : that.currentState != null) return false;
+    if (hostName != null ? !hostName.equals(that.hostName) : that.hostName != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = clusterName != null ? clusterName.hashCode() : 0;
+    result = 31 * result + (hostName != null ? hostName.hashCode() : 0);
+    result = 31 * result + (componentName != null ? componentName.hashCode() : 0);
+    result = 31 * result + (currentState != null ? currentState.hashCode() : 0);
+    return result;
+  }
+}

Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentStateEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentStateEntityPK.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentStateEntityPK.java?rev=1384149&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentStateEntityPK.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentStateEntityPK.java Wed Sep 12 22:22:10 2012
@@ -0,0 +1,84 @@
+/**
+ * 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.ambari.server.orm.entities;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class ServiceComponentStateEntityPK implements Serializable {
+
+  private String clusterName;
+
+  @Id
+  @Column(name = "cluster_name")
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  private String hostName;
+
+  @Id
+  @Column(name = "host_name")
+  public String getHostName() {
+    return hostName;
+  }
+
+  public void setHostName(String hostName) {
+    this.hostName = hostName;
+  }
+
+  private String componentName;
+
+  @Id
+  @Column(name = "component_name")
+  public String getComponentName() {
+    return componentName;
+  }
+
+  public void setComponentName(String componentName) {
+    this.componentName = componentName;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    ServiceComponentStateEntityPK that = (ServiceComponentStateEntityPK) o;
+
+    if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
+    if (componentName != null ? !componentName.equals(that.componentName) : that.componentName != null) return false;
+    if (hostName != null ? !hostName.equals(that.hostName) : that.hostName != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = clusterName != null ? clusterName.hashCode() : 0;
+    result = 31 * result + (hostName != null ? hostName.hashCode() : 0);
+    result = 31 * result + (componentName != null ? componentName.hashCode() : 0);
+    return result;
+  }
+}

Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentStateEntityPK.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceConfigEntity.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceConfigEntity.java?rev=1384149&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceConfigEntity.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceConfigEntity.java Wed Sep 12 22:22:10 2012
@@ -0,0 +1,125 @@
+/**
+ * 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.ambari.server.orm.entities;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Table(name = "serviceconfig", schema = "ambari", catalog = "")
+@Entity
+public class ServiceConfigEntity {
+
+  private Integer configVersion;
+
+  @Column(name = "config_version")
+  @Id
+  @GeneratedValue(strategy = GenerationType.AUTO)
+  public Integer getConfigVersion() {
+    return configVersion;
+  }
+
+  public void setConfigVersion(Integer configVersion) {
+    this.configVersion = configVersion;
+  }
+
+  private String clusterName;
+
+  @Column(name = "cluster_name", nullable = false, insertable = false, updatable = false)
+  @Basic
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  private String serviceName;
+
+  @Column(name = "service_name", nullable = false, insertable = false,updatable = false)
+  @Basic
+  public String getServiceName() {
+    return serviceName;
+  }
+
+  public void setServiceName(String serviceName) {
+    this.serviceName = serviceName;
+  }
+
+  private String configSnapshot = "";
+
+  @Column(name = "config_snapshot", nullable = false)
+  @Basic
+  public String getConfigSnapshot() {
+    return configSnapshot;
+  }
+
+  public void setConfigSnapshot(String configSnapshot) {
+    this.configSnapshot = configSnapshot;
+  }
+
+  private Date configSnapshotTime;
+
+  @Column(name = "config_snapshot_time", nullable = false)
+  @Temporal(TemporalType.TIMESTAMP)
+  public Date getConfigSnapshotTime() {
+    return configSnapshotTime;
+  }
+
+  public void setConfigSnapshotTime(Date configSnapshotTime) {
+    this.configSnapshotTime = configSnapshotTime;
+  }
+
+  ClusterServiceEntity clusterServiceEntity;
+
+  @ManyToOne
+  @JoinColumns(value = {@JoinColumn(name = "cluster_name", referencedColumnName = "cluster_name"), @JoinColumn(name = "service_name", referencedColumnName = "service_name")})
+  public ClusterServiceEntity getClusterServiceEntity() {
+    return clusterServiceEntity;
+  }
+
+  public void setClusterServiceEntity(ClusterServiceEntity clusterServiceEntity) {
+    this.clusterServiceEntity = clusterServiceEntity;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    ServiceConfigEntity that = (ServiceConfigEntity) o;
+
+    if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
+    if (configSnapshot != null ? !configSnapshot.equals(that.configSnapshot) : that.configSnapshot != null)
+      return false;
+    if (configVersion != null ? !configVersion.equals(that.configVersion) : that.configVersion != null) return false;
+    if (serviceName != null ? !serviceName.equals(that.serviceName) : that.serviceName != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = configVersion != null ? configVersion.hashCode() : 0;
+    result = 31 * result + (clusterName != null ? clusterName.hashCode() : 0);
+    result = 31 * result + (serviceName != null ? serviceName.hashCode() : 0);
+    result = 31 * result + (configSnapshot != null ? configSnapshot.hashCode() : 0);
+    return result;
+  }
+}

Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceConfigEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntity.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntity.java?rev=1384149&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntity.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntity.java Wed Sep 12 22:22:10 2012
@@ -0,0 +1,98 @@
+/**
+ * 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.ambari.server.orm.entities;
+
+import javax.persistence.*;
+
+@javax.persistence.IdClass(ServiceDesiredStateEntityPK.class)
+@javax.persistence.Table(name = "servicedesiredstate", schema = "ambari", catalog = "")
+@Entity
+public class ServiceDesiredStateEntity {
+
+  private String clusterName = "";
+
+  @javax.persistence.Column(name = "cluster_name", insertable = false, updatable = false)
+  @Id
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  private String serviceName = "";
+
+  @javax.persistence.Column(name = "service_name", nullable = false, insertable = false, updatable = false)
+  @Id
+  public String getServiceName() {
+    return serviceName;
+  }
+
+  public void setServiceName(String serviceName) {
+    this.serviceName = serviceName;
+  }
+
+  private Integer desiredHostRoleMapping = 0;
+
+  @javax.persistence.Column(name = "desired_host_role_mapping", nullable = false)
+  @Basic
+  public Integer getDesiredHostRoleMapping() {
+    return desiredHostRoleMapping;
+  }
+
+  public void setDesiredHostRoleMapping(Integer desiredHostRoleMapping) {
+    this.desiredHostRoleMapping = desiredHostRoleMapping;
+  }
+
+  ClusterServiceEntity clusterServiceEntity;
+
+  @ManyToOne
+  @JoinColumns(value = {@JoinColumn(name = "cluster_name", referencedColumnName = "cluster_name"), @JoinColumn(name = "service_name", referencedColumnName = "service_name")})
+  public ClusterServiceEntity getClusterServiceEntity() {
+    return clusterServiceEntity;
+  }
+
+  public void setClusterServiceEntity(ClusterServiceEntity clusterServiceEntity) {
+    this.clusterServiceEntity = clusterServiceEntity;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    ServiceDesiredStateEntity that = (ServiceDesiredStateEntity) o;
+
+    if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
+    if (desiredHostRoleMapping != null ? !desiredHostRoleMapping.equals(that.desiredHostRoleMapping) : that.desiredHostRoleMapping != null)
+      return false;
+    if (serviceName != null ? !serviceName.equals(that.serviceName) : that.serviceName != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = clusterName != null ? clusterName.hashCode() : 0;
+    result = 31 * result + (serviceName != null ? serviceName.hashCode() : 0);
+    result = 31 * result + (desiredHostRoleMapping != null ? desiredHostRoleMapping.hashCode() : 0);
+    return result;
+  }
+}

Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntityPK.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntityPK.java?rev=1384149&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntityPK.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntityPK.java Wed Sep 12 22:22:10 2012
@@ -0,0 +1,70 @@
+/**
+ * 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.ambari.server.orm.entities;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class ServiceDesiredStateEntityPK implements Serializable {
+
+  private String clusterName;
+
+  @Id
+  @Column(name = "cluster_name")
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  private String serviceName;
+
+  @Id
+  @Column(name = "service_name")
+  public String getServiceName() {
+    return serviceName;
+  }
+
+  public void setServiceName(String serviceName) {
+    this.serviceName = serviceName;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    ServiceDesiredStateEntityPK that = (ServiceDesiredStateEntityPK) o;
+
+    if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
+    if (serviceName != null ? !serviceName.equals(that.serviceName) : that.serviceName != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = clusterName != null ? clusterName.hashCode() : 0;
+    result = 31 * result + (serviceName != null ? serviceName.hashCode() : 0);
+    return result;
+  }
+}

Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntityPK.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceStateEntity.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceStateEntity.java?rev=1384149&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceStateEntity.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceStateEntity.java Wed Sep 12 22:22:10 2012
@@ -0,0 +1,123 @@
+/**
+ * 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.ambari.server.orm.entities;
+
+import javax.persistence.*;
+
+@javax.persistence.IdClass(ServiceStateEntityPK.class)
+@javax.persistence.Table(name = "servicestate", schema = "ambari", catalog = "")
+@Entity
+public class ServiceStateEntity {
+
+  private String clusterName;
+
+  @javax.persistence.Column(name = "cluster_name", insertable = false, updatable = false)
+  @Id
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  private String hostName;
+
+  @javax.persistence.Column(name = "host_name", insertable = false, updatable = false)
+  @Id
+  public String getHostName() {
+    return hostName;
+  }
+
+  public void setHostName(String hostName) {
+    this.hostName = hostName;
+  }
+
+  private String serviceName;
+
+  @javax.persistence.Column(name = "service_name", insertable = false, updatable = false)
+  @Id
+  public String getServiceName() {
+    return serviceName;
+  }
+
+  public void setServiceName(String serviceName) {
+    this.serviceName = serviceName;
+  }
+
+  private String currentState;
+
+  @javax.persistence.Column(name = "current_state")
+  @Basic
+  public String getCurrentState() {
+    return currentState;
+  }
+
+  public void setCurrentState(String currentState) {
+    this.currentState = currentState;
+  }
+
+  ClusterServiceEntity clusterServiceEntity;
+
+  @ManyToOne
+  @JoinColumns(value = {@JoinColumn(name = "cluster_name", referencedColumnName = "cluster_name"), @JoinColumn(name = "service_name", referencedColumnName = "service_name")})
+  public ClusterServiceEntity getClusterServiceEntity() {
+    return clusterServiceEntity;
+  }
+
+  public void setClusterServiceEntity(ClusterServiceEntity clusterServiceEntity) {
+    this.clusterServiceEntity = clusterServiceEntity;
+  }
+
+  private HostEntity hostEntity;
+
+  @ManyToOne
+  @JoinColumn(name = "host_name")
+  public HostEntity getHostEntity() {
+    return hostEntity;
+  }
+
+  public void setHostEntity(HostEntity hostEntity) {
+    this.hostEntity = hostEntity;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    ServiceStateEntity that = (ServiceStateEntity) o;
+
+    if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
+    if (currentState != null ? !currentState.equals(that.currentState) : that.currentState != null) return false;
+    if (hostName != null ? !hostName.equals(that.hostName) : that.hostName != null) return false;
+    if (serviceName != null ? !serviceName.equals(that.serviceName) : that.serviceName != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = clusterName != null ? clusterName.hashCode() : 0;
+    result = 31 * result + (hostName != null ? hostName.hashCode() : 0);
+    result = 31 * result + (serviceName != null ? serviceName.hashCode() : 0);
+    result = 31 * result + (currentState != null ? currentState.hashCode() : 0);
+    return result;
+  }
+}

Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceStateEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceStateEntityPK.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceStateEntityPK.java?rev=1384149&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceStateEntityPK.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceStateEntityPK.java Wed Sep 12 22:22:10 2012
@@ -0,0 +1,84 @@
+/**
+ * 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.ambari.server.orm.entities;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class ServiceStateEntityPK implements Serializable {
+
+  private String clusterName;
+
+  @Id
+  @Column(name = "cluster_name")
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  private String hostName;
+
+  @Id
+  @Column(name = "host_name")
+  public String getHostName() {
+    return hostName;
+  }
+
+  public void setHostName(String hostName) {
+    this.hostName = hostName;
+  }
+
+  private String serviceName;
+
+  @Id
+  @Column(name = "service_name")
+  public String getServiceName() {
+    return serviceName;
+  }
+
+  public void setServiceName(String serviceName) {
+    this.serviceName = serviceName;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    ServiceStateEntityPK that = (ServiceStateEntityPK) o;
+
+    if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
+    if (hostName != null ? !hostName.equals(that.hostName) : that.hostName != null) return false;
+    if (serviceName != null ? !serviceName.equals(that.serviceName) : that.serviceName != null) return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = clusterName != null ? clusterName.hashCode() : 0;
+    result = 31 * result + (hostName != null ? hostName.hashCode() : 0);
+    result = 31 * result + (serviceName != null ? serviceName.hashCode() : 0);
+    return result;
+  }
+}

Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceStateEntityPK.java
------------------------------------------------------------------------------
    svn:eol-style = native