{"id":2168,"date":"2016-05-30T07:54:06","date_gmt":"2016-05-30T07:54:05","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2168"},"modified":"2016-05-30T07:54:06","modified_gmt":"2016-05-30T07:54:05","slug":"vaadin-couchbase-crud-sample","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/pt\/vaadin-couchbase-crud-sample\/","title":{"rendered":"Amostra de CRUD do Vaadin\/Couchbase"},"content":{"rendered":"<p>Na semana passada, enquanto eu estava no JFokus, conheci <a href=\"https:\/\/twitter.com\/mattitahvonen\">Matti Tahvonen<\/a>, ele trabalha na <a href=\"https:\/\/vaadin.com\/home\">Vaadin<\/a>. Eles v\u00eam propondo uma estrutura da Web de c\u00f3digo aberto para aplicativos avan\u00e7ados de Internet em Java h\u00e1 anos e fazem isso muito bem. Pessoalmente, fico muito feliz em escrever um aplicativo moderno da Web completo apenas em Java.<\/p>\n<p>Levamos 10 minutos para ter uma amostra funcional do Vaadin CRUD armazenando objetos no Couchbase. O resultado est\u00e1 dispon\u00edvel em <a href=\"https:\/\/github.com\/ldoguin\/couchbase-vaadin-spring-data-example\">Github<\/a>. Desde ent\u00e3o, tamb\u00e9m migrei uma amostra baseada em JPA, tamb\u00e9m dispon\u00edvel <a href=\"https:\/\/github.com\/ldoguin\/spring-data-vaadin-crud\">aqui<\/a>. Voc\u00ea pode ver como \u00e9 necess\u00e1rio muito pouco trabalho e como \u00e9 f\u00e1cil passar do JPA para o Couchbase com o <a href=\"https:\/\/github.com\/ldoguin\/spring-data-vaadin-crud\/commit\/d811d560d68fc37906b85a49a50fd1512108a001\">diferen\u00e7a<\/a>.<\/p>\n<h2>Spring Data Couchbase e Vaadin<\/h2>\n<h3>Gerar o projeto<\/h3>\n<p>A primeira etapa ao iniciar um projeto do Spring \u00e9 ir para <a href=\"https:\/\/start.spring.io\/\">Inicializa\u00e7\u00e3o do Spring<\/a>. Aqui voc\u00ea pode selecionar a vers\u00e3o e as depend\u00eancias que deseja para o seu projeto. Selecione Spring Boot vers\u00e3o 1.4.0 (SNAPSHOT) e adicione Vaadin e Couchbase como depend\u00eancias.<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/original-assets\/2016\/february\/vaadin-couchbase-crud-sample\/vaadincouchbasecrud.png\" \/><\/p>\n<p>Agora voc\u00ea pode gerar o projeto e import\u00e1-lo como um projeto Maven no editor de sua prefer\u00eancia.<\/p>\n<h3>CRUD b\u00e1sico de entidade de pessoa<\/h3>\n<p>Esse exemplo de CRUD vai armazenar <strong>Cliente<\/strong> objetos. Um cliente tem um <em>id<\/em>, a <em>firstName<\/em> e um <em>lastName<\/em>. Al\u00e9m disso, o sobrenome n\u00e3o pode ser nulo. Para expressar isso como uma entidade, voc\u00ea s\u00f3 precisa adicionar a vari\u00e1vel <strong>@Documento<\/strong> na classe, <strong>@Id<\/strong> no campo a ser usado como chave do Couchbase, gere getters e setters e pronto. Para expressar as restri\u00e7\u00f5es n\u00e3o nulas, podemos simplesmente usar as anota\u00e7\u00f5es de valida\u00e7\u00e3o Java <strong>@NotNull.<\/strong> Para garantir que isso seja detectado ao escrever a entidade, precisaremos declarar um bean validador.<\/p>\n<pre>\n<code>package hello;\n\nimport java.util.Objects;\nimport java.util.UUID;\n\nimport javax.validation.constraints.NotNull;\n\nimport org.springframework.data.couchbase.core.mapping.Document;\n\nimport com.couchbase.client.java.repository.annotation.Id;\n\n@Document\npublic class Customer {\n\n    @Id\n    private String id = UUID.randomUUID().toString();\n\n    private String firstName;\n\n    @NotNull\n    private String lastName;\n\n    protected Customer() {\n    }\n\n    public Customer(String firstName, String lastName) {\n        this.firstName = firstName;\n        this.lastName = lastName;\n    }\n\n    public String getId() {\n        return id;\n    }\n\n    public void setId(String id) {\n        this.id = id;\n    }\n\n    public String getFirstName() {\n        return firstName;\n    }\n\n    public void setFirstName(String firstName) {\n        this.firstName = firstName;\n    }\n\n    public String getLastName() {\n        return lastName;\n    }\n\n    public void setLastName(String lastName) {\n        this.lastName = lastName;\n    }\n\n    @Override\n    public String toString() {\n        return String.format(\"Customer[id=%s, firstName=&apos;%s&apos;, lastName=&apos;%s&apos;]\", id, firstName, lastName);\n    }\n\n    @Override\n    public int hashCode() {\n        int hash = 7;\n        hash = 37 * hash + Objects.hashCode(this.id);\n        return hash;\n    }\n\n    @Override\n    public boolean equals(Object obj) {\n        if (this == obj) {\n            return true;\n        }\n        if (obj == null) {\n            return false;\n        }\n        if (getClass() != obj.getClass()) {\n            return false;\n        }\n        final Customer other = (Customer) obj;\n        return Objects.equals(this.id, other.id);\n    }\n\n}\n<\/code><\/pre>\n<h3>O reposit\u00f3rio de clientes<\/h3>\n<p>Depois de definir uma entidade, voc\u00ea precisa criar o reposit\u00f3rio associado. Crie uma interface que estenda a interface <strong>CouchbasePagingAndSortingRepository<\/strong>. Esse reposit\u00f3rio lida com <strong>Cliente<\/strong> com uma String como chave.<\/p>\n<p>Eu redefini o <em>findAll<\/em> para retornar um m\u00e9todo <strong>Lista<\/strong> em vez de um <strong>Iter\u00e1vel<\/strong> pois ele funciona melhor com as estruturas Vaadin. O <em>findAll<\/em> \u00e9 apoiado por uma visualiza\u00e7\u00e3o. Para que suas exibi\u00e7\u00f5es sejam definidas automaticamente, voc\u00ea pode adicionar a op\u00e7\u00e3o<strong> @ViewIndexed <\/strong>anota\u00e7\u00e3o. Voc\u00ea tamb\u00e9m precisa se certificar de que definiu a anota\u00e7\u00e3o <em>spring.data.couchbase.auto-index<\/em> para true em sua propriedade <em>application.properties<\/em> arquivo.<\/p>\n<p>Tamb\u00e9m adicionei um <em>findByLastName(String lastName) <\/em>method. Com base no nome do m\u00e9todo, a consulta N1QL apropriada ser\u00e1 gerada automaticamente. Mas para executar a consulta N1Ql, voc\u00ea precisa de um \u00edndice prim\u00e1rio. Que tamb\u00e9m pode ser gerado automaticamente por meio do m\u00e9todo <strong>@N1QLPrimaryIndexed<\/strong> anota\u00e7\u00e3o.<\/p>\n<pre>\n<code>package hello;\n\nimport java.util.List;\n\nimport org.springframework.data.couchbase.core.query.N1qlPrimaryIndexed;\nimport org.springframework.data.couchbase.core.query.ViewIndexed;\nimport org.springframework.data.couchbase.repository.CouchbasePagingAndSortingRepository;\n\n@ViewIndexed(designDoc = \"customer\")\n@N1qlPrimaryIndexed\npublic interface CustomerRepository extends CouchbasePagingAndSortingRepository<Customer, String> {\n\n    List<Customer> findAll();\n\n    List<Customer> findByLastName(String lastName);\n\n}\n<\/code><\/pre>\n<h3>Configura\u00e7\u00e3o<\/h3>\n<p>Estou usando o spring spring-boot-starter-data-couchbase. Ele oferece autoconfigura\u00e7\u00e3o. Essa autoconfigura\u00e7\u00e3o pode ser ativada definindo o par\u00e2metro <em>spring.couchbase.bootstrap-hosts<\/em> propriedade. At\u00e9 o momento, minha <em>application.properties<\/em> se parece com isso:<\/p>\n<p>\u00a0<\/p>\n<pre>\n<code>spring.couchbase.bootstrap-hosts=localhost\nspring.data.couchbase.auto-index=true\n<\/code><\/pre>\n<p>\u00a0<\/p>\n<h3>Criar um cliente<\/h3>\n<p>Agora tenho tudo o que preciso para salvar um <strong>Cliente<\/strong> Entidade no Couchbase. Podemos tentar isso facilmente com um <strong>CommandLineRunner<\/strong>:<\/p>\n<pre>\n<code>@SpringBootApplication\npublic class Application {\n\n    private static final Logger log = LoggerFactory.getLogger(Application.class);\n\n    public static void main(String[] args) {\n        SpringApplication.run(Application.class);\n    }\n\n    @Bean\n    public CommandLineRunner loadData(CustomerRepository repository) {\n        return (args) -> {\n            repository.save(new Customer(null, \"Dessler\"));\n        };\n    }\n\n    @Bean\n    public Validator validator() {\n        return new LocalValidatorFactoryBean();\n    }\n}\n<\/code><\/pre>\n<p>Voc\u00ea perceber\u00e1 que tamb\u00e9m adicionei o bean validador mencionado anteriormente. Ele usa um <strong><a href=\"https:\/\/docs.spring.io\/spring-data\/couchbase\/docs\/current\/api\/index.html?org\/springframework\/data\/couchbase\/core\/mapping\/event\/ValidatingCouchbaseEventListener.html\">ValidatingCouchbaseEventListener<\/a><\/strong> declarado automaticamente pela configura\u00e7\u00e3o autom\u00e1tica do Spring Boot.<\/p>\n<h3>Usando o Vaadin para a interface do usu\u00e1rio<\/h3>\n<p>O backend est\u00e1 pronto, podemos come\u00e7ar a pensar no frontend. Quero um aplicativo CRUD b\u00e1sico que mostre uma lista de clientes, com a capacidade de adicionar, editar ou remover elementos da lista. Aqui est\u00e1 uma captura de tela:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/original-assets\/2016\/february\/vaadin-couchbase-crud-sample\/vaadincrudui.png\" \/><\/p>\n<p>Para construir isso, come\u00e7amos criando um formul\u00e1rio que permite ao usu\u00e1rio inserir um nome e um sobrenome. Crie uma classe que estenda uma classe <strong>Formul\u00e1rio abstrato<\/strong> de <strong>Cliente<\/strong>. Essa classe n\u00e3o est\u00e1 dispon\u00edvel no Vaadin Core, portanto, precisamos adicionar <a href=\"https:\/\/vaadin.com\/directory#!addon\/viritin\">Viritina<\/a>.<\/p>\n<blockquote><p>O Viritin \u00e9 uma biblioteca de aprimoramento do lado do servidor para o Vaadin. Ela corrige alguns padr\u00f5es ruins na estrutura principal e fornece uma API mais fluente e inteligente para os componentes existentes. Tamb\u00e9m oferece v\u00e1rios aprimoramentos importantes para a vincula\u00e7\u00e3o de dados e fornece componentes completamente novos feitos com a composi\u00e7\u00e3o do lado do servidor (n\u00e3o \u00e9 necess\u00e1rio widgetset).<\/p><\/blockquote>\n<p>E sim, ele fornece o <strong>Formul\u00e1rio abstrato<\/strong> que \u00e9 perfeitamente integrada ao Spring Data e aos validadores. Precisamos editar a classe <em>firstName<\/em> e <em>lastName<\/em> campos do <strong>Cliente<\/strong> portanto, definimos dois campos de texto chamados <em>firstName<\/em> e <em>lastName<\/em>. Eles precisam ter o mesmo nome do campo Customer. O que tamb\u00e9m \u00e9 excelente nesse componente \u00e9 o fato de que ele selecionar\u00e1 a anota\u00e7\u00e3o de valida\u00e7\u00e3o em sua entidade. Dessa forma, voc\u00ea obt\u00e9m valida\u00e7\u00e3o autom\u00e1tica no cliente e no servidor. E ele \u00e9 compat\u00edvel com anota\u00e7\u00f5es mais complexas do que todas as outras.<strong style=\"line-height: 20.8px;\">@NotNull<\/strong><span style=\"line-height: 1.6em;\">\u00a0como <strong>@Tamanho <\/strong>ou <strong>@Padr\u00e3o<\/strong>.<\/span><\/p>\n<pre>\n<code>package hello;\n\nimport org.vaadin.viritin.form.AbstractForm;\nimport org.vaadin.viritin.layouts.MFormLayout;\n\nimport com.vaadin.spring.annotation.SpringComponent;\nimport com.vaadin.spring.annotation.UIScope;\nimport com.vaadin.ui.Component;\nimport com.vaadin.ui.TextField;\n\n@SpringComponent\n@UIScope\npublic class CustomerEditor extends AbstractForm<Customer> {\n\n    \/* Fields to edit properties in Customer entity *\/\n    TextField firstName = new TextField(\"First name\");\n    TextField lastName = new TextField(\"Last name\");\n\n    public CustomerEditor() {\n        setVisible(false);\n    }\n\n    @Override\n    protected Component createContent() {\n        return new MFormLayout(firstName, lastName, getToolbar());\n    }\n\n}\n<\/code><\/pre>\n<p>Agora que o formul\u00e1rio est\u00e1 pronto, podemos criar a interface do usu\u00e1rio completa exibindo a grade da tabela. Esse ser\u00e1 o principal componente de seu aplicativo Vaadin, a p\u00e1gina principal da Web. Como o <strong>CustomerRepository<\/strong> e o <strong>Editor de clientes<\/strong> s\u00e3o Spring beans, podemos injet\u00e1-los diretamente no construtor. Se voc\u00ea estiver familiarizado com a escrita da interface do usu\u00e1rio Java, o c\u00f3digo comentado abaixo deve ser simples.<\/p>\n<pre>\n<code>package hello;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.vaadin.viritin.fields.MTable;\nimport org.vaadin.viritin.layouts.MVerticalLayout;\n\nimport com.vaadin.annotations.Theme;\nimport com.vaadin.server.FontAwesome;\nimport com.vaadin.server.VaadinRequest;\nimport com.vaadin.spring.annotation.SpringUI;\nimport com.vaadin.ui.Button;\nimport com.vaadin.ui.UI;\n\n@SpringUI\n@Theme(\"valo\")\npublic class VaadinUI extends UI {\n\n    private final CustomerRepository repo;\n\n    private final CustomerEditor editor;\n\n    private final MTable<Customer> grid;\n\n    private final Button addNewBtn;\n\n    @Autowired\n    public VaadinUI(CustomerRepository repo, CustomerEditor editor) {\n        this.repo = repo;\n        this.editor = editor;\n        this.grid = new MTable<>(Customer.class).withProperties(\"id\", \"firstName\", \"lastName\").withHeight(\"300px\");\n        this.addNewBtn = new Button(\"New customer\", FontAwesome.PLUS);\n    }\n\n    @Override\n    protected void init(VaadinRequest request) {\n        \/\/ Connect selected Customer to editor or hide if none is selected\n        grid.addMValueChangeListener(e -> {\n            if (e.getValue() == null) {\n                editor.setVisible(false);\n            } else {\n                editor.setEntity(e.getValue());\n            }\n        });\n\n        \/\/ Instantiate and edit new Customer the new button is clicked\n        addNewBtn.addClickListener(e -> editor.setEntity(new Customer(\"\", \"\")));\n\n        \/\/ Listen changes made by the editor, refresh data from backend\n        editor.setSavedHandler(customer -> {\n            repo.save(customer);\n            listCustomers();\n            editor.setVisible(false);\n        });\n\n        editor.setResetHandler(customer -> {\n            editor.setVisible(false);\n            listCustomers();\n        });\n\n        editor.setDeleteHandler(customer -> {\n            repo.delete(customer);\n            listCustomers();\n        });\n\n        \/\/ Initialize listing\n        listCustomers();\n\n        \/\/ build layout\n            setContent(new MVerticalLayout(addNewBtn, grid, editor));\n        }\n\n        private void listCustomers() {\n            grid.setBeans(repo.findAll());\n        }\n\n    }\n<\/code><\/pre>\n<p>E ent\u00e3o est\u00e1 tudo pronto, tudo o que voc\u00ea precisa fazer \u00e9 executar isso como um aplicativo Java Spring Boot normal.  Ent\u00e3o, foi bem f\u00e1cil, n\u00e3o foi?<\/p>","protected":false},"excerpt":{"rendered":"<p>Last week while I was at JFokus I met Matti Tahvonen, he works at Vaadin. They have been proposing an open source web framework for rich Internet applications in Java for years and do it really well. I am personally [&hellip;]<\/p>","protected":false},"author":49,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1815,1818],"tags":[1595,1594],"ppma_author":[9023],"class_list":["post-2168","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-best-practices-and-tutorials","category-java","tag-spring-data-couchbase","tag-vaadin"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Vaadin\/Couchbase CRUD Sample - The Couchbase Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/pt\/vaadin-couchbase-crud-sample\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Vaadin\/Couchbase CRUD Sample\" \/>\n<meta property=\"og:description\" content=\"Last week while I was at JFokus I met Matti Tahvonen, he works at Vaadin. They have been proposing an open source web framework for rich Internet applications in Java for years and do it really well. I am personally [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/pt\/vaadin-couchbase-crud-sample\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-05-30T07:54:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Laurent Doguin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ldoguin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"unstructured.io\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/\"},\"author\":{\"name\":\"Laurent Doguin\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c0aa9b8f1ed51b7a9e2f7cb755994a5e\"},\"headline\":\"Vaadin\/Couchbase CRUD Sample\",\"datePublished\":\"2016-05-30T07:54:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/\"},\"wordCount\":820,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"keywords\":[\"spring-data-couchbase\",\"vaadin\"],\"articleSection\":[\"Best Practices and Tutorials\",\"Java\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/\",\"name\":\"Vaadin\/Couchbase CRUD Sample - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2016-05-30T07:54:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Vaadin\/Couchbase CRUD Sample\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c0aa9b8f1ed51b7a9e2f7cb755994a5e\",\"name\":\"Laurent Doguin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/12929ce99397769f362b7a90d6b85071\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b8c466908092b46634af916b6921f30187a051e4367ded7ac9b1a3f2c5692fd2?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b8c466908092b46634af916b6921f30187a051e4367ded7ac9b1a3f2c5692fd2?s=96&d=mm&r=g\",\"caption\":\"Laurent Doguin\"},\"description\":\"Laurent is a nerdy metal head who lives in Paris. He mostly writes code in Java and structured text in AsciiDoc, and often talks about data, reactive programming and other buzzwordy stuff. He is also a former Developer Advocate for Clever Cloud and Nuxeo where he devoted his time and expertise to helping those communities grow bigger and stronger. He now runs Developer Relations at Couchbase.\",\"sameAs\":[\"https:\/\/x.com\/ldoguin\"],\"honorificPrefix\":\"Mr\",\"birthDate\":\"1985-06-07\",\"gender\":\"male\",\"award\":[\"Devoxx Champion\",\"Couchbase Legend\"],\"knowsAbout\":[\"Java\"],\"knowsLanguage\":[\"English\",\"French\"],\"jobTitle\":\"Director Developer Relation & Strategy\",\"worksFor\":\"Couchbase\",\"url\":\"https:\/\/www.couchbase.com\/blog\/pt\/author\/laurent-doguin\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Vaadin\/Couchbase CRUD Sample - The Couchbase Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/pt\/vaadin-couchbase-crud-sample\/","og_locale":"pt_BR","og_type":"article","og_title":"Vaadin\/Couchbase CRUD Sample","og_description":"Last week while I was at JFokus I met Matti Tahvonen, he works at Vaadin. They have been proposing an open source web framework for rich Internet applications in Java for years and do it really well. I am personally [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/pt\/vaadin-couchbase-crud-sample\/","og_site_name":"The Couchbase Blog","article_published_time":"2016-05-30T07:54:05+00:00","og_image":[{"width":1800,"height":630,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png","type":"image\/png"}],"author":"Laurent Doguin","twitter_card":"summary_large_image","twitter_creator":"@ldoguin","twitter_misc":{"Written by":"unstructured.io","Est. reading time":"7 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/"},"author":{"name":"Laurent Doguin","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c0aa9b8f1ed51b7a9e2f7cb755994a5e"},"headline":"Vaadin\/Couchbase CRUD Sample","datePublished":"2016-05-30T07:54:05+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/"},"wordCount":820,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["spring-data-couchbase","vaadin"],"articleSection":["Best Practices and Tutorials","Java"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/","url":"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/","name":"Vaadin\/Couchbase CRUD Sample - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2016-05-30T07:54:05+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/vaadin-couchbase-crud-sample\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Vaadin\/Couchbase CRUD Sample"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"Blog do Couchbase","description":"Couchbase, o banco de dados NoSQL","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"Blog do Couchbase","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c0aa9b8f1ed51b7a9e2f7cb755994a5e","name":"Laurent Doguin","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/12929ce99397769f362b7a90d6b85071","url":"https:\/\/secure.gravatar.com\/avatar\/b8c466908092b46634af916b6921f30187a051e4367ded7ac9b1a3f2c5692fd2?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b8c466908092b46634af916b6921f30187a051e4367ded7ac9b1a3f2c5692fd2?s=96&d=mm&r=g","caption":"Laurent Doguin"},"description":"Laurent \u00e9 um nerd metaleiro que mora em Paris. Em sua maior parte, ele escreve c\u00f3digo em Java e texto estruturado em AsciiDoc, e frequentemente fala sobre dados, programa\u00e7\u00e3o reativa e outras coisas que est\u00e3o na moda. Ele tamb\u00e9m foi Developer Advocate do Clever Cloud e do Nuxeo, onde dedicou seu tempo e experi\u00eancia para ajudar essas comunidades a crescerem e se fortalecerem. Atualmente, ele dirige as Rela\u00e7\u00f5es com Desenvolvedores na Couchbase.","sameAs":["https:\/\/x.com\/ldoguin"],"honorificPrefix":"Mr","birthDate":"1985-06-07","gender":"male","award":["Devoxx Champion","Couchbase Legend"],"knowsAbout":["Java"],"knowsLanguage":["English","French"],"jobTitle":"Director Developer Relation & Strategy","worksFor":"Couchbase","url":"https:\/\/www.couchbase.com\/blog\/pt\/author\/laurent-doguin\/"}]}},"authors":[{"term_id":9023,"user_id":49,"is_guest":0,"slug":"laurent-doguin","display_name":"Laurent Doguin","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/b8c466908092b46634af916b6921f30187a051e4367ded7ac9b1a3f2c5692fd2?s=96&d=mm&r=g","author_category":"","last_name":"Doguin","first_name":"Laurent","job_title":"","user_url":"","description":"Laurent \u00e9 um nerd metaleiro que mora em Paris. Em sua maior parte, ele escreve c\u00f3digo em Java e texto estruturado em AsciiDoc, e frequentemente fala sobre dados, programa\u00e7\u00e3o reativa e outras coisas que est\u00e3o na moda. Ele tamb\u00e9m foi Developer Advocate do Clever Cloud e do Nuxeo, onde dedicou seu tempo e experi\u00eancia para ajudar essas comunidades a crescerem e se fortalecerem. Atualmente, ele dirige as Rela\u00e7\u00f5es com Desenvolvedores na Couchbase."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/2168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/users\/49"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/comments?post=2168"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/2168\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media?parent=2168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/categories?post=2168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/tags?post=2168"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/ppma_author?post=2168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}