Giter VIP home page Giter VIP logo

mcommerce-partie1's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mcommerce-partie1's Issues

Import du projet est impossible dans une version récente d'IntelliJ (2019.1.3 par exemple)

Solution :

  1. Dans le pom.xml modifier la version de spring-boot-starter-parent (la 2.2.0.RELEASE fonctionne pour moi). Modifier également la dépendance de spring-boot-starter-test ainsi 👍

     <dependency>
     	<groupId>org.springframework.boot</groupId>
     	<artifactId>spring-boot-starter-test</artifactId>
     	<scope>test</scope>
     	<exclusions>
     		<exclusion>
     			<groupId>org.junit.vintage</groupId>
     			<artifactId>junit-vintage-engine</artifactId>
     		</exclusion>
     	</exclusions>
     </dependency>
    
  2. Dans ProductController.java, remplacer "productDao.delete(id);" par "productDao.deleteById(id);"

  3. Modifier la classe de test comme suit :

@SpringBootTest
public class MicrocommerceApplicationTests {

@Test
public void contextLoads() {
}

... et modifier les imports (supprimer ceux qui sont obsolètes)

version du starter en cause lors du démarrage : erreur bloquante. Correction et impacts; demande d'évolution.

Le projet ne démarre plus : j'ai proposé une nouvelle version du package "spring-boot-starter-parent" afin de ne plus avoir le problème.

<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>2.1.5.RELEASE</version>
	<relativePath/> <!-- lookup parent from repository -->
</parent>

Cependant, il y a un impact dan le ProductController sur la méthode delete(id) : il faut passer l'objet product lequel contient l'id en paramètre dorénavant delete(product).
Pour réaliser une suppression par le biais de l'id, préférer deleteById(id).

Cela implique de modifier un poil le cours, mais c'est mieux que de fournir une TP qui ne fonctionne plus et un cours qui commence à montrer des choses qui ne fonctionne plus.

Idem, pour cette annotation Swagger :

@Api( description="API pour es opérations CRUD sur les produits.")

le description= est marqué comme Deprecated
=> ceci fonctionne :

@Api("API pour des opérations CRUD sur les produits.")

L'insertion dans la table H2 plante...

La sequence n'a pas été mise à jour après les insertions des 3 lignes au démarrage de l'application.

Il faut remplacer le fichier data.sql par ce contenu :

-- http://h2database.com/html/main.html

-------------------------
-- For H2 Database only
-------------------------

INSERT INTO product VALUES(1, 'Ordinateur portable' , 350, 120);
INSERT INTO product VALUES(2, 'Aspirateur Robot' , 500, 200);
INSERT INTO product VALUES(3, 'Table de Ping Pong' , 750, 400);

ALTER SEQUENCE HIBERNATE_SEQUENCE RESTART WITH 4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.