- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
birt barcode tool Java Persistence API annotations in Java
Java Persistence API annotations DataMatrix Encoder In Java Using Barcode generation for Java Control to generate, create DataMatrix image in Java applications. www.OnBarcode.comRecognizing Data Matrix In Java Using Barcode recognizer for Java Control to read, scan read, scan image in Java applications. www.OnBarcode.comC.2 Java Persistence API annotations
DataBar Generator In Java Using Barcode maker for Java Control to generate, create GS1 DataBar image in Java applications. www.OnBarcode.comECC200 Generation In Java Using Barcode creator for Java Control to generate, create Data Matrix 2d barcode image in Java applications. www.OnBarcode.comThese are the annotations used for the Java Persistence API.
Drawing Barcode In Java Using Barcode encoder for Java Control to generate, create Barcode image in Java applications. www.OnBarcode.comQuick Response Code Generation In Java Using Barcode drawer for Java Control to generate, create QR Code 2d barcode image in Java applications. www.OnBarcode.comC.2.1 Defining domain objects
Linear Generation In Java Using Barcode creator for Java Control to generate, create Linear 1D Barcode image in Java applications. www.OnBarcode.comIdentcode Encoder In Java Using Barcode creation for Java Control to generate, create Identcode image in Java applications. www.OnBarcode.comThe following annotations are used to define domain objects such as entities, embedded objects, and entity identity. javax.persistence.Entity Marks a POJO as a JPA entity. Encoding Data Matrix In Java Using Barcode printer for Android Control to generate, create Data Matrix ECC200 image in Android applications. www.OnBarcode.comEncoding Data Matrix 2d Barcode In Java Using Barcode maker for Java Control to generate, create Data Matrix 2d barcode image in Java applications. www.OnBarcode.com@Target(TYPE) @Retention(RUNTIME) public @interface Entity { String name() default ""; } Create Barcode In .NET Framework Using Barcode creation for Reporting Service Control to generate, create Barcode image in Reporting Service applications. www.OnBarcode.comRecognizing PDF-417 2d Barcode In Visual C# Using Barcode recognizer for VS .NET Control to read, scan read, scan image in .NET applications. www.OnBarcode.comjavax.persistence.Embeddable Marks a POJO as an embeddable object (stored as a part of another entity). Barcode Generator In .NET Using Barcode creator for Visual Studio .NET Control to generate, create Barcode image in .NET applications. www.OnBarcode.comDecoding Code 39 Extended In Java Using Barcode decoder for Java Control to read, scan read, scan image in Java applications. www.OnBarcode.com@Target({TYPE}) @Retention(RUNTIME) public @interface Embeddable {} ANSI/AIM Code 128 Reader In C#.NET Using Barcode recognizer for .NET Control to read, scan read, scan image in VS .NET applications. www.OnBarcode.comGenerating Barcode In Java Using Barcode creation for Android Control to generate, create Barcode image in Android applications. www.OnBarcode.comjavax.persistence.Embedded Specifies that a persistence field or property is an embeddable class.
QR Code Creator In None Using Barcode creator for Office Excel Control to generate, create QR Code JIS X 0510 image in Microsoft Excel applications. www.OnBarcode.comDecode Barcode In .NET Using Barcode Control SDK for ASP.NET Control to generate, create, read, scan barcode image in ASP.NET applications. www.OnBarcode.com@Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface Embedded {} Barcode Creation In Objective-C Using Barcode generator for iPhone Control to generate, create Barcode image in iPhone applications. www.OnBarcode.comBarcode Creation In None Using Barcode generation for Font Control to generate, create Barcode image in Font applications. www.OnBarcode.comjavax.persistence.Id Denotes a persistence field or property that is the unique identifier for an entity. @Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface Id {} javax.persistence.IdClass Used to define a composite primary key.
@Target({TYPE}) @Retention(RUNTIME) public @interface IdClass { Class value(); } javax.persistence.EmbeddedId Denotes an embeddable object as the unique identifier for an entity.
@Target({TYPE}) @Retention(RUNTIME) public @interface EmbeddedId {} APPENDIX C
Annotations reference
C.2.2 Defining domain object data
These annotations are used to define entity data. javax.persistence.Transient Marks a field or property as transient (not persisted). @Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface Transient {} javax.persistence.Lob Specifies that a persistence field or property be mapped to a large object type (BLOB or CLOB) in the database. @Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface Lob {} javax.persistence.Temporal Specifies the mapping data type of a persistence field or property as java.util. Date or java.util.Calendar. @Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface Temporal { TemporalType value(); } public enum TemporalType { java.sql.Date DATE, java.sql.Time TIME, TIMESTAMP java.sql.Timestamp } javax.persistence.Enumerated Denotes options for a persistence field or property of type enumerated.
@Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface Enumerated { EnumType value() default ORDINAL; } public enum EnumType { ORDINAL, STRING } Java Persistence API annotations
C.2.3 Mapping entity data The annotations in this section are used to map entity data to the database. javax.persistence.Table Defines the primary table an entity is mapped to.
@Target({TYPE}) @Retention(RUNTIME) public @interface Table { String name() default ""; Table catalog String catalog() default ""; Table schema String schema() default ""; UniqueConstraint[] uniqueConstraints() default {}; } javax.persistence.SecondaryTable Defines secondary table an entity is mapped to.
@Target({TYPE}) @Retention(RUNTIME) public @interface SecondaryTable { String name(); Table catalog String catalog() default ""; String schema() default ""; PrimaryKeyJoinColumn[] pkJoinColumns() default {}; UniqueConstraint[] uniqueConstraints() default {}; } Table schema
javax.persistence.UniqueConstraint Defines a unique constraint for a table used for entity mapping.
@Target({}) @Retention(RUNTIME) public @interface UniqueConstraint { String[] columnNames(); } javax.persistence.Column Maps an entity field or property to a table column.
@Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface Column { String name() default ""; boolean unique() default false; boolean nullable() default true; boolean insertable() default true; boolean updatable() default true; Column DDL String columnDefinition() default ""; String table() default ""; int length() default 255; Decimal precision int precision() default 0; int scale() default 0; Decimal scale } APPENDIX C
Annotations reference
javax.persistence.Basic Specifies some simple mapping attributes. Can be used with any association mapping or specify the fetch type for a field or property. @Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface Basic { FetchType fetch() default EAGER; boolean optional() default true; } javax.persistence.AttributeOverride Overrides the mapping of an entity property or field. This annotation is not discussed in this book. We encourage you to explore it on your own. @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME) public @interface AttributeOverride { String name(); Column column(); } javax.persistence.AttributeOverrides Specifies multiple mapping overrides. This annotation is not discussed in this book. We encourage you to explore it on your own. @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME) public @interface AttributeOverrides { AttributeOverride[] value(); } javax.persistence.GeneratedValue Used for automatic generation of values; typically used for primary keys. @Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface GeneratedValue { GenerationType strategy() default AUTO; String generator() default ""; } public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO } javax.persistence.TableGenerator Denotes a generator that may be used for automatic key generation using a sequence table. @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME) public @interface TableGenerator { Unique generator name String name(); String table() default ""; Java Persistence API annotations
Table catalog String catalog() default ""; String schema() default ""; Table schema String pkColumnName() default ""; String valueColumnName() default ""; String pkColumnValue() default ""; int initialValue() default 0; Amount to increment by int allocationSize() default 50; UniqueConstraint[] uniqueConstraints() default {}; javax.persistence.SequenceGenerator Denotes a generator that may be used for automatic key generation using a database sequence. @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME) public @interface SequenceGenerator { Unique generator name String name(); String sequenceName() default ""; Name of database sequence int initialValue() default 1; int allocationSize() default 50; Amount to increment by }
|
|