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
| comment = {"author": "fred", | |
| "date": new Date(), | |
| "text": "Best Movie Ever"} | |
| db.posts.update({"_id": ObjectId("554a2380df506c53b1a78647")}, {$push:{"comments": comment}}); |
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
| package hibernate; | |
| import org.hibernate.SessionFactory; | |
| import org.hibernate.boot.registry.StandardServiceRegistryBuilder; | |
| import org.hibernate.cfg.Configuration; | |
| import org.hibernate.service.ServiceRegistry; | |
| public class hibernateUtils { |
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
| package hibernate; | |
| import org.hibernate.Session; | |
| public class ProteinTracker { | |
| public static void main(String[] args) { | |
| Session session = hibernateUtils.getSessionFactory().openSession(); | |
| session.beginTransaction(); | |
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
| package hibernate; | |
| public class User { | |
| private int id; | |
| private String name; | |
| private int total; | |
| private int goal; | |
| public int getId() { |
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
| package com.mattdalesio.morphiaTesting; | |
| import java.util.List; | |
| import org.mongodb.morphia.Datastore; | |
| import org.mongodb.morphia.Morphia; | |
| import org.mongodb.morphia.query.Query; | |
| import org.mongodb.morphia.query.UpdateOperations; | |
| import org.mongodb.morphia.query.UpdateResults; |
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
| package com.mattdalesio.morphiaTesting; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import org.bson.types.ObjectId; | |
| import org.mongodb.morphia.annotations.*; | |
| @Entity("employees") | |
| @Indexes( |
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
| select * into [new_database]..tbl_MY_TABLE | |
| from [old_database]..tbl_MY_TABLE |
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
| import groovy.sql.Sql; | |
| import java.sql.Connection | |
| import java.sql.DriverManager; | |
| import java.sql.SQLException; | |
| import java.util.Properties; | |
| class GroovySQLTesting { |
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
| import groovy.sql.Sql; | |
| import java.sql.Connection | |
| import java.sql.DriverManager; | |
| import java.sql.SQLException; | |
| import java.util.Properties; | |
| class GroovyInsertPersonOutputIdParameter { |
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
| package groovyCollectionTesting | |
| class GroovyCollectionTesting { | |
| static main(args) { | |
| def person1 = new Person("matt", "dalesio", 30) | |
| def person2 = new Person("matt", "smith", 30) | |
| def person3 = new Person("melissa", "cowan", 26) | |