Internal Website Search

51-100 of 200 results

ID format in objectdb 2.x for JDOHelper.getObjectId

db tuotrial. I am just wondering, in objectdb 1.x, when i am tring to get the object id ... .toString() = 3:1 , which is not an integer and this object has two feild object id and type id ... .x to 2.x. And how can i just get the object id without type id . Thanks, Binit binitbhaskar Binit

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

Posting Sample Code

warnings (There is no ID defined for this entity hierarchy, The class should have a no-arg public or

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

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;       

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

javax.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

javax.persistence.metamodel.IdentifiableType

SingularAttribute getDeclaredId (Class  type) Return the attribute that corresponds to the id ... 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 has an id

javax.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

javax.persistence.TableGenerator

", table=" ID _GEN", pkColumnName="GEN_KEY", valueColumnName="GEN_VALUE", pkColumnValue="EMP_ ID ", allocationSize=1) @ Id @GeneratedValue(strategy=TABLE, generator="empGen") int id ; ... } Example 2: @Entity public class Address { ... @TableGenerator( name="addressGen", table=" ID _GEN", pkColumnName="GEN

javax.persistence.OneToOne

( name="CUSTREC_ ID ", unique=true, nullable=false, updatable=false) public CustomerRecord ... : @Entity public class Employee { @ Id Integer id ; @OneToOne @MapsId EmployeeInfo info; ... } // On EmployeeInfo class: @Entity public class EmployeeInfo { @ Id Integer id ; ... } Example 3

javax.persistence.GeneratedValue

conjunction with the Id annotation. The use of the GeneratedValue annotation is only required ... primary keys. Example 1: @ Id @GeneratedValue(strategy=SEQUENCE, generator="CUST_SEQ") @Column(name="CUST_ ID ") public Long getId() { return id ; } Example 2: @ Id @GeneratedValue(strategy=TABLE, generator

javax.persistence.MapKeyJoinColumn

public class Company { @ Id int id ; ... @OneToMany // unidirectional @JoinTable(name="COMPANY ... VideoStore { @ Id int id ; String name; Address location; ... @ElementCollection @CollectionTable(name ... ="MOVIE", referencedColumnName=" ID ") Map videoInventory; ... } @Entity public class Movie { @ Id long

javax.persistence.MapKeyClass

and vice versa. Example 1: @Entity public class Item { @ Id int id ; ... @ElementCollection ... Item { @ Id int id ; ... @ElementCollection Map images; ... } Example 3: @Entity public class Company { @ Id int id ; ... @OneToMany(targetEntity=com.example.VicePresident.class) @MapKeyClass(com.example

javax.persistence.AttributeOverride

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 ... : @MappedSuperclass public class Employee { @ Id protected Integer id ; @Version protected Integer version

SingularAttribute.isId() - JPA Method

JPA Method in javax.persistence.metamodel.SingularAttribute boolean isId () Is the attribute an id attribute. This method will return true if the attribute is an attribute that corresponds to a simple id , an embedded id , or an attribute of an id class. Return: boolean indicating whether the attribute is an id Since: JPA 2.0

javax.persistence.metamodel.SingularAttribute

: type of attribute Since: JPA 2.0 boolean isId () Is the attribute an id attribute. This method will return true if the attribute is an attribute that corresponds to a simple id , an embedded id , or an attribute of an id class. Return: boolean indicating whether the attribute is an id Since: JPA 2.0

javax.persistence.AssociationOverrides

public class Employee { @ Id protected Integer id ; @Version protected Integer version; @ManyToOne ... void setId(Integer id ) { ... } public Address getAddress() { ... } public void setAddress(Address ... ) { ... } ... } @Entity @AssociationOverrides({ @AssociationOverride( name="address", joinColumns=@JoinColumn("ADDR_ ID

javax.persistence.AssociationOverride

=@JoinColumn(name="ADDR_ ID ")) // address field mapping overridden to ADDR_ ID foreign key public class ... in the ContactInfo class @Entity public class Employee { @ Id int id ; @AssociationOverride( name ... .class) List phoneNumbers; } @Entity public class PhoneNumber { @ Id int number; @ManyToMany(mappedBy

javax.persistence.ManyToOne

(optional=false) @JoinColumn(name="CUST_ ID ", nullable=false, updatable=false) public Customer getCustomer() { return customer; } Example 2: @Entity public class Employee { @ Id int id ; @Embedded JobInfo ... ; // Bidirectional } @Entity public class ProgramManager { @ Id int id ; @OneToMany(mappedBy="jobInfo

javax.persistence.ColumnResult

this annotation in the metadata. Example: Query q = em.createNativeQuery( "SELECT o. id AS order_ id , " + "o ... i " + "WHERE (order_quantity 25) AND (order_item = i. id )", "OrderResults"); @SqlResultSetMapping ... (name=" id ", column="order_ id "), @FieldResult(name="quantity", column="order_quantity"), @FieldResult

javax.persistence.FieldResult

fields of an entity class. Example: Query q = em.createNativeQuery( "SELECT o. id AS order_ id , " + "o ... _quantity 25) AND (order_item = i. id )", "OrderResults"); @SqlResultSetMapping(name="OrderResults", entities={ @EntityResult(entityClass=com.acme.Order.class, fields={ @FieldResult(name=" id ", column="order

javax.persistence.SqlResultSetMapping

.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 ... =com.acme.Order.class, fields={ @FieldResult(name=" id ", column="order_ id "), @FieldResult(name="quantity

javax.persistence.Convert

conversion of the following: Id attributes, version attributes, relationship attributes ... { ... } @Entity public class Employee { @ Id long id ; @Convert(converter=BooleanToIntegerConverter.class ... Employee { @ Id long id ; ... // EmployeeDateConverter is applied automatically EmployeeDate startDate

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

Step 3: Define an EJB Session Bean

Guest g ORDER BY g. id ", Guest.class); return query.getResultList(); } } The GuestDao session bean (EJB

Getting Started with JPA and NetBeans

-  x and  y . For this tutorial, besides the Java JDK (8 or above) and the NetBeans IDE

[ODB1] Chapter 7 - JDOQL Queries

result collections by object IDs from lower to higher, which means that objects will be returned in

javax.jdo.spi.PersistenceCapable

(int id , String name, and Float salary) would have the method generated: void ... .storeIntField (0, oid. id ); fm.storeStringField (1, oid.name); fm.storeObjectField (2, oid.salary ... this PersistenceCapable instance to the Object Id instance. For classes using single field identity

javax.jdo.datastore.DataStoreCache

the parameter instance from the second-level cache. Parameters: oid - the object id of the instance to evict ... . Parameters: oids - the object ids of the instance to evict. Since: JDO 2.0 void evictAll (Object... oids) Evict the parameter instances from the second-level cache. Parameters: oids - the object ids

javax.jdo.PersistenceManagerFactory

. Since: JDO 1.0 String getServerTimeZoneID () Gets the TimeZone ID of the server associated with this PersistenceManagerFactory. If not set, assume that the server has the same TimeZone ID as the client ... setServerTimeZoneID (String timezoneid) Sets the TimeZone ID of the server associated

javax.jdo.spi.JDOImplHelper

for each key field in the ObjectId. For example, an ObjectId class that has three key fields ( int id ... (PersistenceCapable oid, ObjectIdFieldConsumer fm) { fm.storeIntField (0, oid. id ); fm ... that has three key fields ( int id , String name , and Float salary ) would have the method generated