Select Stuinfo from stuinfo
就可以,在QL语言没有* 

解决方案 »

  1.   


    scott是一个实体bean映射的名称。有stuinfo属性
    Select scottBean.stuinfo from scott as scottBean
      

  2.   

    <entity>
          <ejb-name>CustomerEJB</ejb-name>
          <local-home>com.titan.customer.CustomerHomeLocal</local-home>
          <local>com.titan.customer.CustomerLocal</local>
          <ejb-class>com.titan.customer.CustomerBean</ejb-class>
          <persistence-type>Container</persistence-type>
          <prim-key-class>java.lang.Integer</prim-key-class>
          <reentrant>false</reentrant>
          <cmp-version>2.x</cmp-version>
          <!--QL语句中间引用的名称,必须唯一-->
          <abstract-schema-name>Customer</abstract-schema-name>
          <cmp-field>
            <field-name>id</field-name>
          </cmp-field>
          <cmp-field>
            <field-name>lastName</field-name>
          </cmp-field>
          <cmp-field>
            <field-name>firstName</field-name>
          </cmp-field>
          <cmp-field>
            <field-name>hasGoodCredit</field-name>
          </cmp-field>
          <primkey-field>id</primkey-field>
          <security-identity>
            <use-caller-identity />
          </security-identity>
          <query>
            <query-method>
              <method-name>findAllCustomersWithReservations</method-name>
              <method-params />
            </query-method>
            <ejb-ql>SELECT OBJECT( cust ) FROM Reservation res, IN (res.customers) cust</ejb-ql>
          </query>
          <query>
            <query-method>
              <method-name>findDistinctCustomersWithReservations</method-name>
              <method-params />
            </query-method>
            <ejb-ql>SELECT DISTINCT OBJECT( cust ) FROM Reservation res,
              IN (res.customers) cust</ejb-ql>
          </query>
          <query>
            <query-method>
              <method-name>findByAmericanExpress</method-name>
              <method-params />
            </query-method>
            <ejb-ql>SELECT OBJECT(c) FROM Customer AS c
              WHERE c.creditCard.organization = 'American Express'</ejb-ql>
          </query>
          <query>
            <query-method>
              <method-name>findByGoodCredit</method-name>
              <method-params />
            </query-method>
            <ejb-ql>SELECT OBJECT(c) FROM Customer AS c
              WHERE c.hasGoodCredit = TRUE</ejb-ql>
          </query>
          <query>
            <query-method>
              <method-name>ejbSelectByCity</method-name>
              <method-params>
                <method-param>java.lang.String</method-param>
                <method-param>java.lang.String</method-param>
              </method-params>
            </query-method>
            <ejb-ql>SELECT OBJECT( c ) FROM Customer AS c
            WHERE c.homeAddress.state = ?2
            AND c.homeAddress.city = ?1</ejb-ql>
          </query>
          <query>
            <query-method>
              <method-name>findInStates</method-name>
              <method-params />
            </query-method>
            <ejb-ql>SELECT OBJECT( c ) FROM Customer c
              WHERE c.homeAddress.state IN ('GA', 'MA')</ejb-ql>
          </query>
          <query>
            <query-method>
              <method-name>findNotInStates</method-name>
              <method-params />
            </query-method>
            <ejb-ql>SELECT OBJECT( c ) FROM Customer c
              WHERE c.homeAddress.state NOT IN ('GA', 'MA')</ejb-ql>
          </query>
          <query>
            <query-method>
              <method-name>findHomeAddressIsNull</method-name>
              <method-params />
            </query-method>
            <ejb-ql>SELECT OBJECT( c ) FROM Customer c
              WHERE c.homeAddress IS NULL</ejb-ql>
          </query>
          <query>
            <query-method>
              <method-name>findHomeAddressIsNotNull</method-name>
              <method-params />
            </query-method>
            <ejb-ql>SELECT OBJECT( c ) FROM Customer c
              WHERE c.homeAddress IS NOT NULL</ejb-ql>
          </query>
          <query>
            <query-method>
              <method-name>findHyphenatedLastNames</method-name>
              <method-params />
            </query-method>
            <ejb-ql>SELECT OBJECT( c ) FROM Customer c
              WHERE c.lastName LIKE '%-%'</ejb-ql>
          </query>
          <query>
            <query-method>
              <method-name>findByLastNameLength</method-name>
              <method-params />
            </query-method>
            <ejb-ql>SELECT OBJECT( c ) FROM Customer c
            WHERE LENGTH(c.lastName) &gt; 6 AND
            LOCATE('Monson', c.lastName) &gt; 0</ejb-ql>
          </query>
          <query>
            <query-method>
              <method-name>ejbSelectGeneric</method-name>
              <method-params>
                <method-param>java.lang.String</method-param>
                <method-param>java.lang.Object[]</method-param>
              </method-params>
            </query-method>
            <ejb-ql />
          </query>
          <query>
            <query-method>
              <method-name>ejbSelectCountOfBostonZips</method-name>
              <method-params />
            </query-method>
            <ejb-ql>SELECT DISTINCT COUNT(c.homeAddress.zip)
            FROM Customer AS c
            WHERE c.homeAddress.zip LIKE '0211%'</ejb-ql>
          </query>
          <query>
            <query-method>
              <method-name>findByOrderedLastName</method-name>
              <method-params />
            </query-method>
            <ejb-ql>SELECT OBJECT( c ) FROM Customer AS c
              ORDER BY c.lastName DESC</ejb-ql>
          </query>
        </entity>
      

  3.   

    Select object(o) from stuinfo