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 may improve code organization by separating the JPQL ... whose name is  "Country.findAll" that retrieves all the  Country objects in the database

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)

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 referred to as projection. The field values ... c. name FROM Country AS c", String.class); List results = query. getResultList (); Only singular

Query Parameters in JPA

execution, because it eliminates the need for 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

Schema Update

... ... A element has two roles: If the optional new- name attribute is specified, the package name is changed from the original name , which is specified by the required name attribute, to the new name . All the classes in that package are moved to the new package name . In addition, whether or not a new

FROM clause (JPQL / Criteria API)

, and the same query can also be written as follows: SELECT c FROM Country c By default, the name of an entity class in a JPQL query is the unqualified name of the class (e.g. just Country with no package name ). The default name can be overridden by specifying another name explicitly in the @Entity 's

ORDER BY clause (JPQL / Criteria API)

Expressions The following query returns names of countries whose population size is at least one million people, ordered by the country name : SELECT c. name FROM Country c WHERE c.population 1000000 ORDER BY c. name When an ORDER BY clause exists it is the last to be executed. First the FROM clause

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 (i.e. the short class name excluding 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

jakarta.persistence.metamodel.ManagedType

Attribute getAttribute ( String name ) Return the attribute of the managed type that corresponds to the specified name . Parameters: name - the name of the represented attribute Returns: attribute with given name . Throws: IllegalArgumentException - if attribute of the given name is not present in

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