HQL vs criteria API vs pure criteria API

You have three options: 1) If you are not pinned to Critera api, I recommend to use HQL instead of Criteria API Date d = new SimpleDateFormat(« yyyy-MM-dd »).parse(« 2014-10-12 »); Query query = session.createQuery(« select count(*) from Visit v where trunc(v.date)=:date and v.visitor.id=:visitorId »); query.setParameter(« date », d); query.setParameter(« visitorId », 1L); Long count = (Long) query.uniqueResult(); 2) If you want to use Criteria … Lire la suite HQL vs criteria API vs pure criteria API

Évaluez ceci :

Overrid the http status codes returned by Amazon API Gateway in a POST method ?

We have  to create an integration response that maps the default response to 201 method response. Follow these steps to fix that: 1. Create a method response with status code 201. Delete the method response with status code 200 if that is not required. 2. Delete the default integration response (that maps default HTTP status to 200 … Lire la suite Overrid the http status codes returned by Amazon API Gateway in a POST method ?

Évaluez ceci :

Play with the AmazonServiceException (and Subclasses) response in Api Gateway integration response

AmazonServiceException (and Subclasses) AmazonServiceException is the most common exception that you’ll experience when using the AWS SDK for Java. This exception represents an error response from an AWS service. For example, if you try to terminate an Amazon EC2 instance that doesn’t exist, EC2 will return an error response and all the details of that error … Lire la suite Play with the AmazonServiceException (and Subclasses) response in Api Gateway integration response

Évaluez ceci :

How to drop all connexion to your database PostgreSQL

How to see Amazon RDS (postgres) connection limit? select * from pg_settings where name=’max_connections’; for t2.micro for example we have 87 max connexion for large.micro 522 i think xD you have always try t close hibernate session if yu use it to make connexion to databases in order to do some (insertions , reading …)   … Lire la suite How to drop all connexion to your database PostgreSQL

Évaluez ceci :

How to give API gateway permission to invoke lambda function through api or cli?

Source Quora forum How to give API gateway permission to invoke lambda function through api or cli? from aws You must grant API Gateway access permission to the IAM user who will perform the tasks. The IAM user must have full access to work with Lambda. For this, you can use or customize the managed … Lire la suite How to give API gateway permission to invoke lambda function through api or cli?

Évaluez ceci :

How to create Api Gateway with terraform

Terraform gives us possibility to write these ressources for our api_gateway : aws_api_gateway_account aws_api_gateway_api_key aws_api_gateway_authorizer aws_api_gateway_base_path_mapping aws_api_gateway_client_certificate aws_api_gateway_deployment aws_api_gateway_documentation_part aws_api_gateway_documentation_version aws_api_gateway_domain_name aws_api_gateway_gateway_response aws_api_gateway_integration  ==> to specify  proxy or not , wich lambda mock endpoint.. aws_api_gateway_integration_response  ====>to specify  proxy or not , wich lambda mock endpoint.. aws_api_gateway_method  : POST GET aws_api_gateway_method_response  ====> aws_api_gateway_method_settings aws_api_gateway_model aws_api_gateway_resource  =====> … Lire la suite How to create Api Gateway with terraform

Évaluez ceci :

Terraform EOF escaped format

This piece of code creates an sqs ressource if we don’t use the EOf we should then give the json payloads with the escaped formats like this resource « aws_sqs_queue » « terraform_queue » { name = « terraform-example-queue » delay_seconds = 90 max_message_size = 2048 message_retention_seconds = 86400 receive_wait_time_seconds = 10 #redrive_policy = « {\ »deadLetterTargetArn\ »:\ »${aws_sqs_queue.terraform_queue_deadletter.arn}\ »,\ »maxReceiveCount\ »:4} » policy= « {\ »Version\ »:\ »2012-10-17\ »,\ »Statement\ »:[{\ »Action\ »:[\ »sqs:*\ »],\ »Effect\ »:\ »Allow\ »,\ »Resource\ »:\ »*\ »}]} » tags { Environment = … Lire la suite Terraform EOF escaped format

Évaluez ceci :