/*-
 * Copyright (c) 2015 Red Hat, Inc.
 *
 * Licensed 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.fedoraproject.insim.model;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

/**
 * @author Mikolaj Izdebski
 */
@Entity
public class Repository implements Serializable {

    private static final long serialVersionUID = 1;

    @Id
    @GeneratedValue
    private Integer id;

    @Column(nullable = false)
    private Timestamp creationTime;

    @ManyToOne(optional = false)
    private Collection collection;

    @Column(nullable = false)
    private Boolean active;

    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Timestamp getCreationTime() {
        return creationTime;
    }

    public void setCreationTime(Timestamp creationTime) {
        this.creationTime = creationTime;
    }

    public Collection getCollection() {
        return this.collection;
    }

    public void setCollection(Collection collection) {
        this.collection = collection;
    }

    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }

}

@@ -857,63 +857,185 @@
 nce.
-ManyToOne;%0A%0A/**%0A * @author Mikolaj Izdebski%0A */%0A@Entity
+Index;%0Aimport javax.persistence.ManyToOne;%0Aimport javax.persistence.Table;%0A%0A/**%0A * @author Mikolaj Izdebski%0A */%0A@Entity%0A@Table(indexes = %7B @Index(columnList = %22creationTime%22) %7D)
 %0Apub

Add index on Repository.creationTime