Home Database Mysql Tutorial seam2.2根据已有数据库(postgresql)生成项目

seam2.2根据已有数据库(postgresql)生成项目

Jun 07, 2016 pm 03:37 PM
postgresql database

一,建数据库 进入pgAdmin新建一个数据库然后用eclipse的插件ErMaster导出sql或者是自己手写sql新建数据表 ,这里新建了一个名为test的数据库 里面有两个表,member和department,为多对一的关系,注意不要忘了设置主键 二,进入seam目录运行 ./seam setup ./seam

一,建数据库
进入pgAdmin新建一个数据库然后用eclipse的插件ErMaster导出sql或者是自己手写sql新建数据表
,这里新建了一个名为test的数据库Alt text
里面有两个表,member和department,为多对一的关系,注意不要忘了设置主键
二,进入seam目录运行 ./seam setup ./seam create-project ./seam generate
1.运行./seam setup
首先是输入项目需要在哪个目录下生成,可以自己设置 Alt text
然后是设置jboss路径,其它的选项默认就好Alt text
输入项目的名字
Alt text
richfaces的配置,默认就好Alt text
部署方式,选择earAlt text
输入项目的包名,action为home和list的存放目录,model为实体bean,test是一些测试Alt text
下面是数据库的配置,依次输入数据库的名字,驱动jar包目录,往下三项默认,之后是新建的那个数据库的名字,最后是用户名和密码,其余默认即可Alt text

2.运行 ./seam create-project ./seam generate
这些都是全自动的,依次运行就可以

最后不要忘了把MemberList.java中的member改为其它名字,原因是member是postgres的关键字,会发生冲突

<code>    <span>private</span> <span>static</span> <span>final</span> String EJBQL = <span>"select m from Member m"</span>;

    <span>private</span> <span>static</span> <span>final</span> String[] RESTRICTIONS = {
            <span>"lower(m.password) like lower(concat(#{memberList.member.password},'%'))"</span>,
            <span>"lower(m.name) like lower(concat(#{memberList.member.name},'%'))"</span>,
            };</code>
Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How does Go language implement the addition, deletion, modification and query operations of the database? How does Go language implement the addition, deletion, modification and query operations of the database? Mar 27, 2024 pm 09:39 PM

How does Go language implement the addition, deletion, modification and query operations of the database?

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

Detailed tutorial on establishing a database connection using MySQLi in PHP

Comparison of similarities and differences between MySQL and PL/SQL Comparison of similarities and differences between MySQL and PL/SQL Mar 16, 2024 am 11:15 AM

Comparison of similarities and differences between MySQL and PL/SQL

How does Hibernate implement polymorphic mapping? How does Hibernate implement polymorphic mapping? Apr 17, 2024 pm 12:09 PM

How does Hibernate implement polymorphic mapping?

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos

An in-depth analysis of how HTML reads the database An in-depth analysis of how HTML reads the database Apr 09, 2024 pm 12:36 PM

An in-depth analysis of how HTML reads the database

Analysis of the basic principles of MySQL database management system Analysis of the basic principles of MySQL database management system Mar 25, 2024 pm 12:42 PM

Analysis of the basic principles of MySQL database management system

Tips and practices for handling Chinese garbled characters in databases with PHP Tips and practices for handling Chinese garbled characters in databases with PHP Mar 27, 2024 pm 05:21 PM

Tips and practices for handling Chinese garbled characters in databases with PHP

See all articles