Objective 2 Working with Java data types

Objective 2 Working with java data types 2.1 Primitive Data Type Casting: Widening casting: dal piccolo al grande. Viene fatto implicitamente.  byte –> short –> int –> long–> float –> double Narrowing casting: Dal grande al piccolo deve essere fatto esplicitamente.  

HQL

Hibernate Query Language (HQL) is an object-oriented query language, similar to SQL, but instead of operating on tables and columns, HQL works with persistent objects and their properties. HQL queries are translated by Hibernate into conventional SQL queries, which in turns perform an action on a database.

transazioni manuali Java hibernate jpa

  Approfondimento Come funzionano le transazioni: https://www.objectdb.com/java/jpa/start/connection   Entity Class Database Connection CRUD Operations 1. Definizione di una classe di entità JPA: Per poter archiviare Pointoggetti nel database utilizzando JPA è necessario definire una classe di entità . Una classe di entità JPA è una classe POJO (Plain Old Java Object), cioè una normale classe Java che è contrassegnata … Leggi tutto

API Rest cosa sono

API Rest cosa sono Rest: è un approccio architetturale alla creazione di Web API basate su protocollo HTTP che abbiano le seguenti caratteristiche: sono risorse accessibili tramite endpoint URI (Uniform Resource Indices) possono essere JSON o XML utilizzano i principali metodi HTTP: GET/POST/PUT/DELETE… deve essere senza stato (stateless come http) HTTP: è il principale protocollo … Leggi tutto

Jar

jar è come se fosse un .exe che non gira su sistema operativo e che puoi startare cliccando sull’icona, ma gira come processo sulla JVM

OCA – Java collection

  Answered Correctly You had to select 3 option(s) Standard JDK provides no subclasses of ArrayList. It does. Direct Known Subclasses: AttributeList, RoleList, RoleUnresolvedList An ArrayList cannot store primitives. This is true because only objects can be stored in it. Note that the following is valid though: List l = new ArrayList(); l.add(1); Although 1 … Leggi tutto

RISOLUZIONE ESERCIZI

variabile di classe ci accedo senza dover istanziare oggetto. è static (sempre private per incapsulamento) varibaile di instazna devo prima istanziare non è static What is the result of compiling and executing the following class? 1: public class ParkRanger { 2: int birds = 10; 3: public static void main(String[] data) { 4: int trees … Leggi tutto