54 lines
1.5 KiB
Java

package com.alterdekim.game.entity;
import com.alterdekim.game.xml.NumericBooleanSerializer;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name="phone_messages")
@JsonRootName(value = "item")
public class PhoneMessage {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@JsonProperty(value = "Id")
private Long id;
@JsonProperty
@JacksonXmlProperty(isAttribute = true, localName = "DateSent")
@Column(nullable = false)
private String dateSent;
@JsonProperty
@JacksonXmlProperty(isAttribute = true, localName = "SenderId")
@Column(nullable = false)
private Long senderId;
@JsonProperty
@JacksonXmlProperty(isAttribute = true, localName = "SenderName")
@Column(nullable = false)
private String senderName;
@JsonProperty
@JacksonXmlProperty(isAttribute = true, localName = "Text")
@Column(nullable = false)
private String text;
@JsonProperty
@JacksonXmlProperty(isAttribute = true, localName = "IsNew")
@Column(nullable = false)
@JsonSerialize(using= NumericBooleanSerializer.class)
private Boolean isNew;
}