114 words

Using a file extension other than .odb

#1
2011-07-28 07:32

I love that ObjectDB's implementation of Persistence.createEntityManagerFactory(...) treats a parameter ending in .odb as a file name rather than a persistence unit name.  It makes opening a DB in my app as easy as selecting it from a file chooser.

However, I wish that I could use a file extension other than odb.  Since this functionality is already non-standard, why not allow it?  Perhaps any string beginning with "file://" could be treated this way.

Edit: Or maybe better, provide the non-standard method Persistence.createEntityManagerFactory(File, Map).

kjkrum
kjkrum's picture
Joined on 2011-07-28
User Post #1
#2
2011-07-29 14:20

This is a good idea, thanks.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #489
#3
2011-08-10 21:16

Starting version 2.2.9 you can use other extensions, as long as the url starts with objectdb:

For example:

    EntityManagerFactory emf =
        Persistence.createEntityManagerFactory("objectdb:db.my");
ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #512
#4
2011-08-11 04:51

My life is complete!

kjkrum
kjkrum's picture
Joined on 2011-07-28
User Post #5

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