Skip to content

Instantly share code, notes, and snippets.

View cosbor11's full-sized avatar
🤓
always coding

Chris Osborn cosbor11

🤓
always coding
View GitHub Profile
// Create a sailboat named Stars and Stripes
Sailboat sailboat = new Sailboat();
sailboat.setRegistrationCode("USA11");
sailboat.setName("Stars and Stripes");
// Create the list of crew members
List<CrewMember> crew = new ArrayList<CrewMember>();
CrewMember skipper = new CrewMember();
skipper.setFirstName("Dennis");
manager.saveEntity(sailbaot);
System.out.println("Sailboat " + sailboat.getName() + " has " sailboat.getCrew().size() + " crew members");
Sailboat savedSailboat = manager.findById("USA11");
System.out.println("Sailboat has " + savedSailboat.getCrew().size() + " crew members");
System.out.println(savedSailboat.getCrew(0).getFirstName() + " is the skipper on boat " + savedSailboat.getCrew(0).getSailboat().getName());
@cosbor11
cosbor11 / SampleServer.java
Last active October 23, 2015 08:04
onyx database server application
@Configuration
@EnableAutoConfiguration
@EnableWebMvc
@ComponentScan(basePackages = {"com.onyx"})
@EnableTransactionManagement
@PropertySource(value = {"classpath:application.properties", "file:${user.home}/onyx/database.properties"}, ignoreResourceNotFound = true)
public class SampleServer extends DefaultOnyxDatabaseApplication
{
public SampleServer()
{
@cosbor11
cosbor11 / application.properties
Last active October 23, 2015 05:26
Onyx Web Database Server properties file
# database credentials
onyx.database.location=${user.home}/.onyx/sandbox.web.oxd
onyx.database.username=admin
onyx.database.password=admin
server.port=8080
# properties file location
properties.file=${user.home}/onyx/database.properties
properties.default.file=application.properties
@cosbor11
cosbor11 / pom.xml
Last active August 16, 2016 15:44
onyx web database pom
<groupId>com.onyxdevtools.samples</groupId>
<artifactId>onyx-database-web-server</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<name>onyx-database-web-server</name>
<dependencies>
<dependency>
@cosbor11
cosbor11 / Podfile
Last active October 23, 2015 06:33
Podfile including path to Onyx Client CocoaPod
platform :ios, '8.0'
inhibit_all_warnings!
xcodeproj 'OnyxDatabaseExample/OnyxDatabaseExample'
link_with 'OnyxDatabaseExample', 'OnyxDatabaseExampleTests', 'OnyxDatabaseExampleUITests'
pod 'OnyxClient', :path => 'Pods/onyx-database-client-cocoapod'
pod 'SVProgressHUD', :head
@cosbor11
cosbor11 / console
Created October 23, 2015 06:26
Pod Install
pod install
@cosbor11
cosbor11 / AppDelegate
Created October 23, 2015 06:45
AppDelegate configuration for PersistenceManagerAPI
@interface AppDelegate ()
@property (nonatomic, strong) SWGPersistenceManagerApi* persistenceManager;
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
@cosbor11
cosbor11 / Person.h
Created October 23, 2015 06:58
Objective C Person header
#import <Foundation/Foundation.h>
#import "SWGObject.h"
NS_ASSUME_NONNULL_BEGIN
@interface Person : SWGObject
@property (nullable, nonatomic, retain) NSString *firstName;
@property (nullable, nonatomic, retain) NSString *lastName;
@property (nullable, nonatomic, retain) NSNumber *personId;