This file contains 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
var myModule = require('myModule'); | |
myModule.doSomethingCool(100) | |
.then(function (result) { | |
console.log(result); | |
}) | |
.error(function (err) { | |
console.error(err); | |
}); |
This file contains 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
var myModule = require('myModule'); | |
myModule.doSomethingCool(100, function (err, result) { | |
if (err) { | |
console.error(err); | |
return; | |
} | |
console.log(result); | |
}); |
This file contains 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
var someOtherModule = require('./someOtherModule'); | |
var myModule = function() { | |
this.doSomethingCool(input, callback) { | |
// do something cool here | |
return someOtherModule.thatReturnsPromises(input) | |
.then(function (result) { | |
// do something else cool here | |
return result++; | |
}) |
This file contains 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
doTheFirstThing() | |
.then(doTheSecondThing) | |
.then(doTheThirdThing) | |
.then(doTheFourthThing); |
This file contains 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
doTheFirstThing(function (err, firstResult) { | |
doTheSecondThing(firstResult, function (err, secondResult) { | |
doTheThirdThing(secondResult, function (err, thirdResult) { | |
doTheFourthThing(thirdResult); | |
}); | |
}); | |
}); |
This file contains 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
@SpringBootApplication | |
public class Application | |
{ | |
private static final Logger log = LoggerFactory.getLogger(Application.class); | |
public static void main(String[] args) | |
{ | |
SpringApplication.run(Application.class); | |
} |
This file contains 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 ... | |
from products product0_ | |
where product0_.buyPrice>? | |
order by product0_.buyPrice desc |
This file contains 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 interface ProductRepository extends CrudRepository<Product, String> | |
{ | |
List<Product> findByBuyPriceGreaterThanOrderByBuyPriceDesc(BigDecimal buyPrice); | |
} |
This file contains 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 ... | |
from employees employee0_ | |
left outer join offices office1_ on employee0_.officeCode=office1_.officeCode | |
where office1_.country<>? |
This file contains 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 ... | |
from employees employee0_ | |
where employee0_.firstName=? and employee0_.lastName=? |