All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.trino.benchto.service.model.QueryInfo Maven / Gradle / Ivy

There is a newer version: 0.30
Show newest version
/*
 * 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 io.trino.benchto.service.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.vladmihalcea.hibernate.type.json.JsonBinaryType;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;

import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import java.io.Serializable;

import static com.google.common.base.MoreObjects.toStringHelper;

@Entity
@Cacheable
@Table(name = "query_info")
@TypeDef(name = "jsonb", typeClass = JsonBinaryType.class)
public class QueryInfo
        implements Serializable
{
    @Id
    @SequenceGenerator(
            name = "query_info_id_seq",
            sequenceName = "query_info_id_seq",
            allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE,
            generator = "query_info_id_seq")
    @Column(name = "id")
    @JsonIgnore
    private long id;

    @NotNull
    @Column(name = "info", columnDefinition = "jsonb")
    @Type(type = "jsonb")
    private String info;

    public long getId()
    {
        return id;
    }

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

    public String getInfo()
    {
        return info;
    }

    public void setInfo(String info)
    {
        this.info = info;
    }

    @Override
    public String toString()
    {
        return toStringHelper(this)
                .add("id", id)
                .add("info", info)
                .toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy