Package org.campware.dream.om

Examples of org.campware.dream.om.Location


     * wouldn't be secure.
     */
    public void doInsert(RunData data, Context context)
        throws Exception
    {
        Location entry = new Location();
        data.getParameters().setProperties(entry);


        String myCode=data.getParameters().getString("locationcode");

        entry.setCreatedBy(data.getUser().getUserName());
        entry.setCreated(new Date());
        entry.setModifiedBy(data.getUser().getUserName());
        entry.setModified(new Date());
       

        if (myCode.equals("AUTO"))
        {
            entry.setLocationCode(getTempCode());

            Connection conn = Transaction.begin(LocationPeer.DATABASE_NAME);
            boolean success = false;
            try {
                entry.save(conn);
                entry.setLocationCode(getRowCode("LO", entry.getLocationId()));
                entry.save(conn);
                Transaction.commit(conn);
                success = true;
   
            } finally {
                if (!success) Transaction.safeRollback(conn);
            }
        }
        else
        {
            entry.save();
        }

    }
View Full Code Here


     * into the database.
     */
    public void doUpdate(RunData data, Context context)
        throws Exception
    {
        Location entry = new Location();
        data.getParameters().setProperties(entry);

        String myCode=data.getParameters().getString("locationcode");
        if (myCode.equals("AUTO"))
        {
            entry.setLocationCode(getRowCode("LO", entry.getLocationId()));
        }

        entry.setCreated(parseDateTime(data.getParameters().getString("created")));
        entry.setModifiedBy(data.getUser().getUserName());
        entry.setModified(new Date());

        entry.setModified(true);
        entry.setNew(false);
        entry.save();

    }
View Full Code Here

    protected boolean getEntry(Criteria criteria, Context context)
    {
        try
        {
            Location entry = (Location) LocationPeer.doSelect(criteria).get(0);
            context.put("entry", entry);
            return true;
        }
        catch (Exception e)
        {
View Full Code Here

    protected boolean getNew(Context context)
    {
        try
        {
            Location entry = new Location();
            context.put("entry", entry);
            return true;
        }
        catch (Exception e)
        {
View Full Code Here

TOP

Related Classes of org.campware.dream.om.Location

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.