"JPA 샘플 클래스 MyEntity"의 두 판 사이의 차이

60번째 줄: 60번째 줄:
}
}
</source>
</source>
==결과 테이블==
{| class='wikitable'
! Column !! Type
|-
| id (Primary) || bigint(20)
|-
| my_big_decimal || decimal(19,2)
|-
| my_blob || longblob
|-
| my_boolean || bit(1)
|-
| my_byte || tinyint(4)
|-
| my_bytes || tinyblob
|-
| my_calendar || datetime
|-
| my_class || varchar(255)
|-
| my_clob || longtext
|-
| my_currency || varchar(255)
|-
| my_date || date
|-
| my_double || double
|-
| my_float || float
|-
| my_integer || int(11)
|-
| my_locale || varchar(255)
|-
| my_long || bigint(20)
|-
| my_serializable || tinyblob
|-
| my_short || smallint(6)
|-
| my_string || varchar(255)
|-
| my_time || time
|-
| my_time_zone || varchar(255)
|-
| my_timestamp || datetime
|}


==같이 보기==
==같이 보기==

2016년 7월 13일 (수) 15:41 판

1 개요

JPA 샘플 클래스 MyEntity
package com.example.myapp;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Currency;
import java.util.Locale;
import java.util.TimeZone;

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

@Entity
public class MyEntity {
	@Id private Long id;
	
	@Column private Integer myInteger;
	@Column private Long myLong;
	@Column private Short myShort;
	@Column private Float myFloat;
	@Column private Double myDouble;
	@Column private String myString;
	@Column private Byte myByte;
	@Column private Byte[] myBytes;
	@Column private Boolean myBoolean;
	@SuppressWarnings("rawtypes")
	@Column private Class myClass;

	// java.sql
	@Column private Timestamp myTimestamp;
	@Column private Date myDate;
	@Column private Time myTime;

	// java.math
	@Column private BigDecimal myBigDecimal;
	
	// java.io
	@Column private Serializable mySerializable;
	
	// java.sql
	@Column private Clob myClob;
	@Column private Blob myBlob;

	// java.util
	@Column private Calendar myCalendar;
	@Column private Locale myLocale;
	@Column private TimeZone myTimeZone;
	@Column private Currency myCurrency;
}

2 결과 테이블

Column Type
id (Primary) bigint(20)
my_big_decimal decimal(19,2)
my_blob longblob
my_boolean bit(1)
my_byte tinyint(4)
my_bytes tinyblob
my_calendar datetime
my_class varchar(255)
my_clob longtext
my_currency varchar(255)
my_date date
my_double double
my_float float
my_integer int(11)
my_locale varchar(255)
my_long bigint(20)
my_serializable tinyblob
my_short smallint(6)
my_string varchar(255)
my_time time
my_time_zone varchar(255)
my_timestamp datetime

3 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}