GWT EJB3 Entity

EJB3 Entity with GWT
1.GWT  client    端需要编译成javascript,所以要在 GWT client端使用EJB Entity,则在 client端需要有Entity的源码,
Entity的源码可以在 EJBModel 打包时换源码打包进jar包(用maven):

<build>
        <!--如果不手动指定resource则默认打包 resources目录下的内容,手动指定后则只打包指定的内容 下例中 ejbmodel为Entity所在目录-->
       <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/ejbmodel/*.java</include>
                </includes>
            </resource>
            <resource>
              <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>
        </resources>
2.    还需要  all enums & interfaces from javax.persistence  java.io.Serializable as an alias for com.google.gwt.user.client.rpc.IsSerializable
参考 http://code.google.com/p/ejb4gwt/

3. 这样Entity Bean 就可以在 client 端通过编译了.

你可能感兴趣的:(JavaScript,java,maven,Google,gwt)