/** * Copyright (c) 2014-2015 Eclectic Logic LLC * * 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 com.eclecticlogic.pedal.dm; // Generated May 28, 2014 8:44:27 AM by Hibernate Tools 4.3.1 import java.util.ArrayList; import java.util.BitSet; import java.util.List; import java.util.Set; import javax.persistence.Column; import javax.persistence.Convert; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Transient; import com.eclecticlogic.pedal.dialect.postgresql.CopyEmptyAsNull; import org.hibernate.annotations.Parameter; import org.hibernate.annotations.Type; import com.eclecticlogic.pedal.dialect.postgresql.CopyAsBitString; import com.eclecticlogic.pedal.dialect.postgresql.CopyConverter; import com.eclecticlogic.pedal.provider.hibernate.ArrayType; import com.eclecticlogic.pedal.provider.hibernate.dialect.PostgresqlArrayPrimitiveName; import com.eclecticlogic.pedal.provider.hibernate.dialect.PostgresqlBitStringUserType; /** * ExoticTypes generated by hbm2java */ @SuppressWarnings("serial") @Entity @Table(name = "exotic_types") public class ExoticTypes implements java.io.Serializable { private String login; private BitSet countries; private Set authorizations; private List scores; private List gpa; private Status status; private String custom; private Color color; private int total; private List capitals = new ArrayList<>(); private Student student; private byte[] image; @Id @Column(name = "login", unique = true, nullable = false) public String getLogin() { return this.login; } public void setLogin(String login) { this.login = login; } @Column(name = "countries", nullable = false, length = 7) @Type(type = "com.eclecticlogic.pedal.provider.hibernate.dialect.PostgresqlBitStringUserType", parameters = @Parameter(name = PostgresqlBitStringUserType.BIT_LENGTH, value = "7")) @CopyAsBitString public BitSet getCountries() { return this.countries; } public void setCountries(BitSet countries) { this.countries = countries; } @Column(name = "authorizations", nullable = false) @Type(type = "com.eclecticlogic.pedal.provider.hibernate.SetType", parameters = @Parameter(name = ArrayType.DIALECT_PRIMITIVE_NAME, value = PostgresqlArrayPrimitiveName.STRING)) public Set getAuthorizations() { return this.authorizations; } public void setAuthorizations(Set authorizations) { this.authorizations = authorizations; } @Column(name = "scores") @Type(type = "com.eclecticlogic.pedal.provider.hibernate.ListType", parameters = { @Parameter(name = ArrayType.DIALECT_PRIMITIVE_NAME, value = PostgresqlArrayPrimitiveName.LONG) }) public List getScores() { return this.scores; } public void setScores(List scores) { this.scores = scores; } @Column(name = "gpa") @Type(type = "com.eclecticlogic.pedal.provider.hibernate.ListType", parameters = { @Parameter(name = ArrayType.DIALECT_PRIMITIVE_NAME, value = PostgresqlArrayPrimitiveName.LONG), @Parameter(name = ArrayType.EMPTY_IS_NULL, value = "false") }) public List getGpa() { return gpa; } public void setGpa(List gpas) { this.gpa = gpas; } @Column(name = "status", nullable = false, length = 2) @Convert(converter = StatusConverter.class) public Status getStatus() { return status; } public void setStatus(Status status) { this.status = status; } @CopyConverter(UppercaseConversionHelper.class) @Column(name = "custom", nullable = false) public String getCustom() { return custom; } public void setCustom(String custom) { this.custom = custom; } @Column(name = "color") @Convert(converter = ColorConverter.class) public Color getColor() { return color; } public void setColor(Color color) { this.color = color; } /** * To test exclusion of fields with parameters since they are not java-bean properties and return type is embeddable. * @param input * @return */ public PlanetId getSomeValue(int input) { return new PlanetId("test", input); } @Column(name = "total", nullable = false) public int getTotal() { return total; } public void setTotal(int total) { this.total = total; } @Column(name = "capitals") @Type(type = "com.eclecticlogic.pedal.provider.hibernate.ListType", parameters = { @Parameter(name = ArrayType.DIALECT_PRIMITIVE_NAME, value = PostgresqlArrayPrimitiveName.STRING)}) @CopyEmptyAsNull public List getCapitals() { return capitals; } public void setCapitals(List capitals) { this.capitals = capitals; } @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "student_id", nullable = false) public Student getStudent() { return student; } public void setStudent(Student student) { this.student = student; } @Transient // Transient should prevent embeddable from being added to copy list. public VehicleIdentifier getVehicleIdentifier() { return null; } public void setVehicleIdentifier() { // noop } @Column(name = "image_data") public byte[] getImage() { return image; } public void setImage(byte[] image) { this.image = image; } }