This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| manager.deleteEntity(savedPerson); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Person deletedPerson = (Person) manager.findById(Person.class, savedPerson.getId()); | |
| if(deletedPerson == null){ | |
| System.out.println("Entity was deleted sucessfully"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| manager.deleteEntities(savedNumbers); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Query query2 = new Query(); | |
| query2.setEntityType(RandomNumber.class); | |
| List<RandomNumber> emptyList = manager.executeQuery(query2); | |
| System.out.println(emptyList.size() + " random numbers exist after deletion"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PersistenceManagerFactory factory = new CacheManagerFactory(); //1 | |
| factory.setCredentials("username", "password"); //2 | |
| factory.initialize(); //3 | |
| PersistenceManager manager = factory.getPersistenceManager(); //4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <dependency> | |
| <groupId>com.onyxdevtools</groupId> | |
| <artifactId>onyx-remote-database</artifactId> | |
| <version>${onyx-database.version}</version> | |
| </dependency> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mvn clean install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <groupId>com.onyxdevtools.samples</groupId> | |
| <artifactId>data-model</artifactId> | |
| <packaging>jar</packaging> | |
| <dependencies> | |
| <dependency> | |
| <groupId>com.onyxdevtools</groupId> | |
| <artifactId>onyx-database</artifactId> | |
| <version>${onyx-database.version}</version> | |
| </dependency> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <groupId>com.onyxdevtools.samples</groupId> | |
| <artifactId>onyx-database-server</artifactId> | |
| <packaging>jar</packaging> | |
| <dependencies> | |
| <dependency> | |
| <groupId>com.onyxdevtools</groupId> | |
| <artifactId>onyx-web-database</artifactId> | |
| <version>${onyx-database.version}</version> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void main(String[] args) throws Exception | |
| { | |
| DatabaseServer server1 = new DatabaseServer(); | |
| server1.setPort(8080); | |
| String pathToOnyxDB = System.getProperty("user.home") | |
| + File.separatorChar + ".onyxdb" | |
| + File.separatorChar + "sandbox" | |
| + File.separatorChar +"remote-db.oxd"; | |
| server1.setCredentials("onyx-remote", "SavingDataIsFun!"); |