222 words

persitencia (Preguntas y respuestas)

#1
2015-08-06 19:46

1ra.pregunta: tengo un formulario y Cuando Grabo mas de un registro, solo me graba el ultimo pero no los anteriores.

2da.Pregunta: Tengo un indice que no se el ID y necesito que mi tabla muestre los datos de acuerdo al indice.

                      Como  puedo hacerlo ?.

Alguien me sugiere algo. Gracias

 

jrchalaco
jrchalaco's picture
Joined on 2015-07-30
User Post #1
#2
2015-08-06 20:00

If previously stored objects are missing it could be either due to a failure to persist them, failure to retrieve them or starting a new empty database every request - more details are needed.

To view a table order by a field use an ORDER BY query. Query execution will be faster in the field is indexed.

Please use English for further questions. Unfortunately this forum doesn't support Spanish or other languages.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #2,293
#3
2015-08-06 20:33

and what happens with the following records I'm adding, ordering in TableModel will automatically or have to rebuild an ORDER BY

jrchalaco
jrchalaco's picture
Joined on 2015-07-30
User Post #2
#4
2015-08-07 10:21

You can define your own custom TableModel implementation by subclassing AbstractTableModel:

  • Implement getRowCount() with a SELECT COUNT query.
  • Implement getValueAt() with an ORDER BY query.
ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #2,294
#5
2015-12-07 20:20

I am creating a database and when you go to create a class, I get the following error. Please could you suggest something, thanks.

com.objectdb.o._PersistenceException: Failed to create a new file 'C:\Program Files\objectdb\objectdb-2.6.4_07\log\odb20151207.log'

EntityManagerFactory registro = Persistence.createEntityManagerFactory(ruta);

the error in this line.          EntityManager emRegistro = registro.createEntityManager();

jrchalaco
jrchalaco's picture
Joined on 2015-07-30
User Post #3
#6
2015-12-07 22:31

Please follow the posting instructions and create a new thread per topic.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #2,351

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel