ObjectDB Database Search

1-50 of 200 results

JPA Named Queries

A named query is a statically defined query with a predefined, unchangeable query string. Using named queries instead of dynamic queries can improve code organization by separating JPQL query ... and @NamedQueries Annotations The following @NamedQuery annotation defines a query named "Country.findAll

JPA Named Queries Annotations

level, separating query logic from business code. Query definitions Declare named queries using the following annotations: Specifies a static, named query in the Jakarta Persistence Query Language (JPQL). It is defined on an entity or mapped superclass and assigned a unique name for retrieval

jakarta.persistence.JoinColumn.name

Jakarta Persistence (JPA) Method in jakarta.persistence.JoinColumn String name (Optional) The name ... ): The concatenation of the following: the name of the referencing relationship property or field of the referencing entity or embeddable class; " _ "; the name of the referenced primary key column

jakarta.persistence.NamedEntityGraph.name

Jakarta Persistence (JPA) Method in jakarta.persistence.NamedEntityGraph String name (Optional) The name used to identify the entity graph in calls to EntityManager.getEntityGraph . If no name is explicitly specified, the name defaults to the entity name of the annotated root entity. Entity graph

jakarta.persistence.Entity.name

Jakarta Persistence (JPA) Method in jakarta.persistence.Entity String name (Optional) The entity name . Defaults to the unqualified name of the entity class. This name is used to refer to the entity in queries. The name must not be a reserved literal in the Jakarta Persistence query language. Default: "" Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.PrimaryKeyJoinColumn.name

Jakarta Persistence (JPA) Method in jakarta.persistence.PrimaryKeyJoinColumn String name (Optional) The name of the primary key column of the current table. Defaults to the same name as the primary key column of the primary table of the superclass ( JOINED mapping strategy); the same name as

jakarta.persistence.CollectionTable.name

Jakarta Persistence (JPA) Method in jakarta.persistence.CollectionTable String name (Optional) The name of the collection table. If not specified, it defaults to the concatenation of the name of the containing entity and the name of the collection attribute, separated by an underscore. Default: "" Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.AttributeOverride.name

Jakarta Persistence (JPA) Method in jakarta.persistence.AttributeOverride String name (Required) The name of the property whose mapping is being overridden if property-based access is being used, or the name of the field if field-based access is used. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.UniqueConstraint.name

Jakarta Persistence (JPA) Method in jakarta.persistence.UniqueConstraint String name (Optional) The name of the constraint. Defaults to a provider-generated name . Default: "" Since: Jakarta Persistence (JPA) 2.0

jakarta.persistence.Table.name

Jakarta Persistence (JPA) Method in jakarta.persistence.Table String name (Optional) The name of the table. Defaults to the entity name . Default: "" Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.TableGenerator.name

Jakarta Persistence (JPA) Method in jakarta.persistence.TableGenerator String name (optional) A unique generator name that can be referenced by one or more classes to be the generator for id values. Defaults to the name of the entity when the annotation occurs on an entity class or primary key

jakarta.persistence.Index.name

Jakarta Persistence (JPA) Method in jakarta.persistence.Index String name (Optional) The name of the index. Defaults to a provider-generated name . Default: "" Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.ForeignKey.name

Jakarta Persistence (JPA) Method in jakarta.persistence.ForeignKey String name (Optional) The name of the foreign key constraint. Defaults to a provider-generated name . Default: "" Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.OrderColumn.name

Jakarta Persistence (JPA) Method in jakarta.persistence.OrderColumn String name (Optional) The name of the ordering column. Defaults to the concatenation of the name of the referencing property or field; " _ "; " ORDER ". Default: "" Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.PersistenceConfiguration.name()

Jakarta Persistence (JPA) Method in jakarta.persistence.PersistenceConfiguration String name () The name of the persistence unit, which may be used by the persistence provider for logging and error reporting. Returns: the name of the persistence unit.. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.MapKeyColumn.name

Jakarta Persistence (JPA) Method in jakarta.persistence.MapKeyColumn String name (Optional) The name of the map key column. The table in which it is found depends upon the context. If the map key ... that is the value of the map. Defaults to the concatenation of the following: the name of the referencing

jakarta.persistence.MapKey.name

Jakarta Persistence (JPA) Method in jakarta.persistence.MapKey String name (Optional) The name of the persistent field or property of the associated entity that is used as the map key. Default: If the name element is not specified, the primary key of the associated entity is used as the map key

jakarta.persistence.MapKeyJoinColumn.name

Jakarta Persistence (JPA) Method in jakarta.persistence.MapKeyJoinColumn String name (Optional) The name of the foreign key column for the map key. The table in which it is found depends ... (only applies if a single join column is used.) The concatenation of the following: the name

jakarta.persistence.JoinTable.name

Jakarta Persistence (JPA) Method in jakarta.persistence.JoinTable String name (Optional) The name of the join table. Defaults to the concatenated names of the two associated primary entity tables, separated by an underscore. Default: "" Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.SequenceGenerator.name

Jakarta Persistence (JPA) Method in jakarta.persistence.SequenceGenerator String name (Optional) A unique generator name that can be referenced by one or more classes to be the generator for primary key values. Defaults to the name of the entity when the annotation occurs on an entity class or

jakarta.persistence.StoredProcedureParameter.name

Jakarta Persistence (JPA) Method in jakarta.persistence.StoredProcedureParameter String name The name of the parameter as defined by the stored procedure in the database. If a name is not specified, it is assumed that the stored procedure uses positional parameters. Default: "" Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.CheckConstraint.name

Jakarta Persistence (JPA) Method in jakarta.persistence.CheckConstraint String name (Optional) The name of the constraint. Defaults to a provider-generated name . Default: "" Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.Column.name

Jakarta Persistence (JPA) Method in jakarta.persistence.Column String name (Optional) The name of the column. Defaults to the property or field name . Default: "" Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.AssociationOverride.name

Jakarta Persistence (JPA) Method in jakarta.persistence.AssociationOverride String name (Required) The name of the relationship property whose mapping is being overridden if property-based access is being used, or the name of the relationship field if field-based access is used. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.PersistenceProperty.name

Jakarta Persistence (JPA) Method in jakarta.persistence.PersistenceProperty String name The name of the property Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.PersistenceContext.name

Jakarta Persistence (JPA) Method in jakarta.persistence.PersistenceContext String name (Optional) The name by which the entity manager is to be accessed in the environment referencing context; not needed when dependency injection is used. Default: "" Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.PersistenceUnit.name

Jakarta Persistence (JPA) Method in jakarta.persistence.PersistenceUnit String name (Optional) The name by which the entity manager factory is to be accessed in the environment referencing context; not needed when dependency injection is used. Default: "" Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.FieldResult.name

Jakarta Persistence (JPA) Method in jakarta.persistence.FieldResult String name Name of the persistent field or property of the class. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.NamedNativeQuery.name

Jakarta Persistence (JPA) Method in jakarta.persistence.NamedNativeQuery String name The name used to identify the query in calls to EntityManager.createNamedQuery . Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.NamedStoredProcedureQuery.name

Jakarta Persistence (JPA) Method in jakarta.persistence.NamedStoredProcedureQuery String name The name used to refer to the query with the EntityManager methods that create stored procedure query objects. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.NamedQuery.name

Jakarta Persistence (JPA) Method in jakarta.persistence.NamedQuery String name (Required) The name used to identify the query in calls to EntityManager.createNamedQuery . Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.NamedSubgraph.name

Jakarta Persistence (JPA) Method in jakarta.persistence.NamedSubgraph String name (Required) The name of the subgraph as referenced from a NamedAttributeNode element. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.SecondaryTable.name

Jakarta Persistence (JPA) Method in jakarta.persistence.SecondaryTable String name (Required) The name of the table. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.DiscriminatorColumn.name

Jakarta Persistence (JPA) Method in jakarta.persistence.DiscriminatorColumn String name (Optional) The name of column to be used for the discriminator. Default: "DTYPE" Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.SqlResultSetMapping.name

Jakarta Persistence (JPA) Method in jakarta.persistence.SqlResultSetMapping String name The name given to the result set mapping, and used to refer to it in the methods of the Query and StoredProcedureQuery APIs. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.QueryHint.name

Jakarta Persistence (JPA) Method in jakarta.persistence.QueryHint String name Name of the hint. Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.ColumnResult.name

Jakarta Persistence (JPA) Method in jakarta.persistence.ColumnResult String name (Required) The name of a column in the SELECT clause of a SQL query Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.criteria.LocalDateField.name

Jakarta Persistence (JPA) Field in jakarta.persistence.criteria.LocalDateField name Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.criteria.LocalDateTimeField.name

Jakarta Persistence (JPA) Field in jakarta.persistence.criteria.LocalDateTimeField name Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.criteria.LocalTimeField.name

Jakarta Persistence (JPA) Field in jakarta.persistence.criteria.LocalTimeField name Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.PersistenceConfiguration.name

Jakarta Persistence (JPA) Field in jakarta.persistence.PersistenceConfiguration name Since: Jakarta Persistence (JPA) 1.0

SELECT clause (JPQL / Criteria API)

, the following query returns country names as String instances, rather than Country objects: SELECT c. name FROM Country AS c Using path expressions , such as c. name , in query results is called ... c. name FROM Country AS c", String.class); List results = query. getResultList (); You can use

Query Parameters in JPA

because it eliminates repeated query compilations. Named Parameters (: name ) The following method retrieves a Country object from the database by its name : public Country getCountryByName( EntityManager em, String name ) { TypedQuery query = em. createQuery ( "SELECT c FROM Country c WHERE c. name = : name

Schema Update

... ... A element has two roles: If you specify the optional new- name attribute, the package name changes from the original name (specified by the required name attribute) to the new name . All classes in that package are moved to the new package. Additionally, regardless of whether a new- name attribute

FROM clause (JPQL / Criteria API)

By default, the name of an entity class in a JPQL query is the unqualified name of the class (for example, Country with no package name ). The default name can be overridden by specifying another name explicitly in the name element of the @Entity annotation. Multiple range variables are allowed

ORDER BY clause (JPQL / Criteria API)

expressions The following query returns the names of countries with a population of at least one million, ordered by country name : SELECT c. name FROM Country c WHERE c.population 1000000 ORDER BY c. name ... because the ORDER BY expression, c.population , is not part of the SELECT clause: SELECT c. name FROM Country c

JPA Persistable Types

, package, or private ), and it can be either concrete or abstract. Entity class names Entity classes are represented in queries by entity names . By default, the entity name is the unqualified name of the entity class (that is, the short class name without the package name ). A different entity name

jakarta.persistence.metamodel.EntityType

Methods Attribute getAttribute ( String name ) Return the attribute of the managed type that corresponds to the specified name . Inherited from ManagedType Parameters: name - the name of the represented attribute Returns: attribute with given name . Throws: IllegalArgumentException - if attribute

jakarta.persistence.metamodel.IdentifiableType

Persistence (JPA) 2.0 Public Instance Methods Attribute getAttribute ( String name ) Return the attribute of the managed type that corresponds to the specified name . Inherited from ManagedType Parameters: name - the name of the represented attribute Returns: attribute with given name . Throws

Step 2: Entity Class and Persistence Unit

, enter src/main/java as Folder Name and click Finish . Open the [New Java Class] dialog box, e.g. by ... ; New Class . Enter  guest as the package name - use  exactly that case sensitive package name . Enter  Guest as the class name - use  exactly that case sensitive class name . Click