ObjectDB Database Search

51-100 of 200 results

Get multiple entities by Id

I'm trying to fetch a list of entities, by their Id . I Use this query: SELECT c FROM User c WHERE c. id IN : ids This querey works as long as I don't set the property " id " as @ Id . If i set @ Id to any other member, this query works, if I set id as @ Id , it stops working and gives zero results

IDs of Entities suddenly became UUIDs?

do have a UUID String as their id instead of Long which is of course causing a lot of troubles. Note ... ID , others a String UUID. Our Base-Entity everything inherits from is declared as usual with Long: @ Id @GeneratedId private Long myId; This has always been working, however, suddenly partial Objects in

Conflicting modifiers .... (javax.persistence.Id, javax.persistence.ManyToOne)

for field uk.co.his.experiment8.cmdline.objdb.CompoundKeyMapItem.container (javax.persistence. Id ... .container (javax.persistence. Id , javax.persistence.ManyToOne) at com.objectdb.o.MSG.d(MSG.java:61 ... .persistence.FlushModeType; import javax.persistence. Id ; import javax.persistence.NamedQueries; import

On ensuring ID available after persist

, which relies on an "external" entity object having a non-null id after it has been passed ... up to another element) I am using the following for the ID : @ Id //@GeneratedValue(strategy = GenerationType.AUTO ... () { return id ; } The javadocs for EntityManager.persist() merely state that it should "Make

Wrong @Id type

Hi,  I have noticed some values of id column suddenly switched to int ... / To repair IDs that have already changed their types you will have to 'touch' the objects and store them again, or use an ObjectDB version before the fix, with an UPDATE queries that change the IDs

EntityManager.find(entityClass, primaryKey) is slow when accessing non-existent IDs

* * EntityManager.find(entityClass, primaryKey) is slow when accessing * non-existent IDs . * * Select queries process non-existent IDs fastest. * */ public class OdbEmFindById { public static final int EVALUATION_LIMIT = 1000000; @Entity public static class X { @EmbeddedId public XId id ; public X() { } public X

Populating entity id before transaction commit

Hi, I have a question about populating auto generated id before transaction commit. We are using ... transaction is committed so all returned entities are not populated with ID in this context. How can I force ODB to populate entity ID before transaction is committed? Or maybe there is another way

Change Sequcene Id

could I change sequcence id ? allocating small value may not be effect. or something other ways ... MyEntity is defined with JPA @Entity public class MyEntity {     @ Id     @GeneratedValue(strategy=GenerationType.IDENTITY)     private Long id ; }   Tsu

multi thread application, id field sporadically null

with the field that is declared as @ Id having the value null (what is not correct, we checked ... Serializable { private static final long serialVersionUID = 1L; @ Id public String nodePath; ... as soon as ... how exactly you create, persist and retrieve the objects. Except the id field, are other fields

Immediately retrieve unique id

= GenerationType.SEQUENCE, generator = "sampleSeqGenerator") @ Id long id ;   The id field is as expected ... etc. that makes use of the id . How do I capture that id without roundtripping? I see pre and post commit, but pre the id isn't generated yet, and post I would have to somehow resave. mbcladwell

Uninitialized primary key (id = 0)

is id =0. What situation will be id =0? TIA gzdillon Lai Yang This happens if you define an id field ... ; @GeneratedValue should solve the problem, unless you already have entity objects with IDs 0 ... table - you can set an initial ID which is larger than any existing ID to avoid any conflict. support Support

World database - Changing country ID

Sample world DB in ObjectDB Explorer - and couldn't find my country, as it has invalid id ( ez instead of cz ). I changed the id of country to "cz". But when I try to find the country: SELECT c FROM Country c WHERE id = "cz" no results are returned. If i find it by name, I can see ID has changed to cz

Create simple index for a Id field

{         @ Id     private Key key = null;     ... public class ObjectDbEntity implements DataItemProvider {        @ Id   ... why. Thanks in advance. Greatings ksii13 E As far as I know, the @ Id is indexed by default

@SequenceGenerator and single id in whole database

of my model enitities, but it looks like id's are generated using only one, shared generator. Is there any ... values), and attaching these generators to @ Id fields in different classes. Make sure you set ... (name = "XXX", sequenceName = "Seq_XXX", initialValue = 1000) @GeneratedValue(generator = "XXX") @ Id

Newbie : How to return the auto-generated ID

ID when I persist a new entity (with @ Id @GeneratedValue annotations applied). I am following ... Deepak Mishra The id is available in the id field so you can simply access it. By default ... to have the id available earlier (immediately after persist ) - you have to switch to sequence or table  value generation strategy. support Support

Multiple @ID

I have an entity with 2 @ ID @Entity public class TheTable extends AbstractMMODataObject { @ Id String userId; @ Id long range; It was a mistake, I really should have just made  range an @Index but it already has millions of records in it. I am wondering if I query select t from  TheTable t where range

Explorer shows Long id, but should be Integer

Hi! I have seen a strange behavior of ObjectDB Explorer: it shows @ Id as being Long, not Integer ... used for one project. If I open one of the entities in the explorer, then I click on it's id (in the sample on parts of the Embedded id ) as if I would want to edit, then I press enter and ObjectDB

Possible issue for default id generator

First all, congratulations to Objectdb team for the excellent work. Possible issue for default id generator when strategy is sequence. Error: Incomplete definition of auto value in field MyTestCase ... and 36: @GeneratedValue(strategy=GenerationType.SEQUENCE)//, generator="seq") @ Id @SequenceGenerator

Persist error @ManyToMany how to define correct entities relationships

Category but they are all refering to same limited set of Category entities (via ID ). There is not changes made to Category from Product. The category ID is taken from the webservice Object ID (unique too). @Entity public class Product implements Serializable { @ Id @GeneratedValue private long id

When using inheritance, you can specify, which ID to use

When storing objects with inheritance, it should be possible to choose, which ID (parent or child class) should be used for new object. For example: public EntityA() {     @ Id     long id ;     String field1; }   public EntityB

General Performance Issues Illustrated with a Specific Method

listPatientsByIDsWithBasicData(String ids ) { Long st = new Date().getTime(); System.out.println("listPatientsByIDsWithBasicData - start - " + st); List cs = new ArrayList (); if ( ids == null || ids .trim ... .health.phsp.pojcs.ClientBasicData(" + "c. id , " + "c.phn, " + "c.person.name, " + "c.person.nic, " + "c

ObjectDB-2.6.9: Failed to commit transaction: Failed to set numeric value of field property Element.id using reflection

to set numeric value of field property com.greensoft.objectdb.test.entity.Element. id using reflection ... value of field property com.greensoft.objectdb.test.entity.Element. id using reflection (error 613 ... .test.entity.Element. id using reflection at com.objectdb.o._PersistenceException.b

Logical "or" works not correcly when field is @Id and first position

only, if the field for the "or" is the first one defined as @ Id . public class OrTest {      ... ;       }         @ Id ... ; @ Id         String b;       

strange object unique ID

at a customer the unique object id of one class changed dramatically from a nurmal number ... the first report of such an issue. Theoretically, this may be caused by a loop that allocates IDs ... , which seems to be functional, except that the automatic ID generator that is used for some

Page #9 entry 0 (key 'bjjl') has 75 extra bytes / Unexpected last index ID: -119 (expected -116)

Please check the attached database file. When running the Doctor, I get   Global Value Errors ------------------- [1] Unexpected last index ID : -119 (expected -116) Page Content Errors ------------------- [1] Page #9 entry 0 has unexpected object format [2] Page #9 entry 0 (key 'bjjl') has 75

InterfaceRef jakarta.persistence.metamodel.MappedSuperclassType

) Return the attribute that corresponds to the id attribute declared by the entity or mapped superclass. Parameters: type - the type of the represented declared id attribute Return: declared id attribute Throws: IllegalArgumentException - if id attribute of the given type is not declared in

InterfaceRef jakarta.persistence.metamodel.IdentifiableType

to the id attribute declared by the entity or mapped superclass. Parameters: type - the type of the represented declared id attribute Return: declared id attribute Throws: IllegalArgumentException - if id attribute of the given type is not declared in the identifiable type or if the identifiable type

InterfaceRef jakarta.persistence.metamodel.EntityType

that corresponds to the id attribute declared by the entity or mapped superclass. Parameters: type - the type of the represented declared id attribute Return: declared id attribute Throws: IllegalArgumentException - if id attribute of the given type is not declared in the identifiable type or

AnnotationRef jakarta.persistence.NamedNativeQuery

, for example: @NamedNativeQuery( name = "findWidgets", query = "SELECT o. id , o.quantity, o.item " + "FROM Order o, Item i " + "WHERE (o.item = i. id ) AND (i.name = 'widget ... ;OrderItems", query = "SELECT o. id , o.quantity, o.item, i. id , i.name, i.description "

InterfaceRef jakarta.persistence.PersistenceUnitUtil

 entity) Return the id of the entity. A generated id is not guaranteed to be available until after the database insert has occurred. Returns null if the entity does not yet have an id . Parameters: entity - entity instance Return: id of the entity Throws: IllegalArgumentException - if the object

IdentifiableType.getId(type) - JPA Method

;Class  type ) Return the attribute that corresponds to the id attribute of the entity or mapped superclass. Parameters: type - the type of the represented id attribute Return: id attribute Throws: IllegalArgumentException - if id attribute of the given type is not present in the identifiable

IdentifiableType.getDeclaredId(type) - JPA Method

(   Class  type ) Return the attribute that corresponds to the id attribute declared by the entity or mapped superclass. Parameters: type - the type of the represented declared id attribute Return: declared id attribute Throws: IllegalArgumentException - if id attribute of the given type

PersistenceUnitUtil.getIdentifier(entity) - JPA Method

 entity ) Return the id of the entity. A generated id is not guaranteed to be available until after the database insert has occurred. Returns null if the entity does not yet have an id . Parameters: entity - entity instance Return: id of the entity Throws: IllegalArgumentException - if the object is found not to be an entity Since: JPA 2.0

AnnotationRef jakarta.persistence.JoinTable

= "CUST_PHONE", joinColumns = @JoinColumn(name = "CUST_ ID ", referencedColumnName = " ID "), inverseJoinColumns = @JoinColumn(name = "PHONE_ ID ", referencedColumnName = " ID ")) This annotation may not be applied to a persistent field or property not annotated

IdentifiableType.hasSingleIdAttribute() - JPA Method

JPA Method in jakarta.persistence.metamodel.IdentifiableType boolean hasSingleIdAttribute () Whether the identifiable type has a single id attribute. Returns true for a simple id or embedded id ; returns false for an idclass. Return: boolean indicating whether the identifiable type has a single id attribute Since: JPA 2.0

AnnotationRef jakarta.persistence.EntityResult

.createNativeQuery( "SELECT o. id , o.quantity, o.item, " + "i. id , i.name, i.description " + "FROM Order o, Item i " + "WHERE (o.quantity 25) AND (o.item = i. id )", "OrderItemResults"); @SqlResultSetMapping( name

AnnotationRef jakarta.persistence.TableGenerator

id numbers from the generator. Since: JPA 1.0 String catalog default "" (Optional) The catalog ... generator name that can be referenced by one or more classes to be the generator for id values ... table default "" (Optional) Name of the table that stores the generated id values. Defaults

AnnotationRef jakarta.persistence.ColumnResult

this annotation in the metadata. Example: {@snippet : Query q = em.createNativeQuery( "SELECT o. id AS order_ id , " + "o.quantity AS order_quantity, " + "o.item AS order_item, " + "i.name AS item_name, " + "FROM Order o, Item i " + "WHERE (order_quantity 25) AND (order_item = i. id )", "OrderResults

AnnotationRef jakarta.persistence.GeneratedValue

to a primary key property or field of an entity or mapped superclass in conjunction with the Id annotation ... : See Also: GenerationType Id TableGenerator SequenceGenerator Since: JPA 1.0 The Auto Generated ... , then the persistence provider supplies a default id generator, of a type compatible with the value

AnnotationRef jakarta.persistence.FieldResult

fields of an entity class. Example: {@snippet : Query q = em.createNativeQuery( "SELECT o. id AS order_ id , " + "o.quantity AS order_quantity, " + "o.item AS order_item, " + "FROM Order o, Item i " + "WHERE (order_quantity 25) AND (order_item = i. id )", "OrderResults"); @SqlResultSetMapping( name

AnnotationRef jakarta.persistence.SqlResultSetMapping

: Query q = em.createNativeQuery( "SELECT o. id AS order_ id , " + "o.quantity AS order_quantity, " + "o ... 25) AND (order_item = i. id )", "OrderResults"); @SqlResultSetMapping( name = "OrderResults", entities

AnnotationRef jakarta.persistence.ConstructorResult

: {@snippet : Query q = em.createNativeQuery( "SELECT c. id , c.name, " + "COUNT(o) as orderCount, " + "AVG(o.price) AS avgOrder " + "FROM Customer c, Orders o " + "WHERE o.cid = c. id " + "GROUP BY c. id

IdentifiableType.getIdClassAttributes() - JPA Method

JPA Method in jakarta.persistence.metamodel.IdentifiableType Set getIdClassAttributes () Return the attributes corresponding to the id class of the identifiable type. Return: id attributes Throws: IllegalArgumentException - if the identifiable type does not have an id class Since: JPA 2.0

SingularAttribute.isId() - JPA Method

JPA Method in jakarta.persistence.metamodel.SingularAttribute boolean isId () Is the attribute an id attribute? This method returns true if the attribute is a plain, an plain, or an attribute of an plain. Return: boolean indicating whether the attribute is an id Since: JPA 2.0

InterfaceRef jakarta.persistence.metamodel.SingularAttribute

: type of attribute Since: JPA 2.0 boolean isId () Is the attribute an id attribute? This method returns ... whether the attribute is an id Since: JPA 2.0 boolean isOptional () Can the attribute be null

PersistenceUnitUtil.getVersion(entity) - JPA Method

until after the database insert has occurred. Returns null if the entity does not yet have an id . Parameters: entity - entity instance Return: id of the entity Throws: IllegalArgumentException - if the object is found not to be an entity Since: JPA 3.2

AnnotationRef jakarta.persistence.AttributeOverride

JPA Annotation AttributeOverride Target: TYPE, METHOD, FIELD Implemented Interfaces: Annotation Used to override the mapping of a Basic (whether explicit or default) property or field or Id property ... property to override a basic mapping or id mapping defined by the mapped superclass or embeddable

IdentifiableType.getIdType() - JPA Method

JPA Method in jakarta.persistence.metamodel.IdentifiableType Type getIdType () Return the type that represents the type of the id . Return: type of id Since: JPA 2.0

AnnotationRef jakarta.persistence.IdClass

primary key of the database table. The primary key fields of the entity must be annotated Id ... with names and types that match the Id fields and properties of the annotated entity class. Since: JPA 1.0

AnnotationRef jakarta.persistence.EmbeddedId

EmbeddedId , then no other field or property of the entity may be annotated Id or EmbeddedId ... annotation may only be used to override those attributes of the embedded id that do not correspond