Quote from: jan on 24.02.2011, 02:33:33
nejak nevidim kde je ten IDENT_REGEX
dúfal som, že to bude v yajco.jar, tak som ho dekompiloval. Žiaľ nebolo




This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Zobrazi� pr�spevky MenuQuote from: jan on 24.02.2011, 02:33:33
nejak nevidim kde je ten IDENT_REGEX
Quote from: Havran on 20.02.2011, 00:22:38
dal som to na FTP, a este aj ine ked tak chcete![]()
Quote from: Havran on 18.02.2011, 16:09:33
ja to mam, ale nemyslim si zase ze by ta kniha bola potrebna na absolvovanie tohto predmetu Smiley
( for(EntityRef er: entities) )
public enum Type {
INTEGER, REAL, STRING;
}
List<Property> property = new ArrayList<Property>();
.
.
.
Property[] p = (Property[])property.toArray(new Property[property.size()]);
return new Entity(name, p);
return new Entity(name, properties.toArray(new Property[]{}));
line.matches(IDENT_REGEX)
package sk.tuke.magsa.personalistika.dao_impl;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.ResultSet;
import sk.tuke.magsa.framework.CRUDDaoImpl;
import sk.tuke.magsa.framework.ValidatorException;
import sk.tuke.magsa.framework.ConnectionPool;
import sk.tuke.magsa.personalistika.entity.Oddelenie;
import sk.tuke.magsa.personalistika.dao.OddelenieDao;
public class OddelenieDaoImpl extends CRUDDaoImpl<Oddelenie> implements OddelenieDao {
public OddelenieDaoImpl(ConnectionPool pool) {
super(pool);
}
protected PreparedStatement prepareInsertStatement(Connection connection, Oddelenie object)
throws SQLException {
String query = "INSERT INTO Oddelenie (nazov, kod, poschodie) VALUES (?, ?, ?)";
PreparedStatement pstm = connection.prepareStatement(query);
pstm.setString(1, object.getNazov());
pstm.setString(2, object.getKod());
pstm.setInt(3, object.getPoschodie());
return pstm;
}
protected PreparedStatement prepareUpdateStatement(Connection connection, Oddelenie object)
throws SQLException {
String query = "UPDATE Oddelenie SET nazov=?, kod=?, poschodie=? where ident=?";
PreparedStatement pstm = connection.prepareStatement(query);
pstm.setString(1, object.getNazov());
pstm.setString(2, object.getKod());
pstm.setInt(3, object.getPoschodie());
pstm.setInt(4, object.getIdent());
return pstm;
}
protected PreparedStatement prepareDeleteStatement(Connection connection, Oddelenie object)
throws SQLException {
String query = "DELETE FROM Oddelenie where ident=?";
PreparedStatement pstm = connection.prepareStatement(query);
pstm.setInt(1, object.getIdent());
return pstm;
}
protected PreparedStatement prepareFindStatement(Connection connection, Integer id) throws
SQLException {
String query = "SELECT * FROM Oddelenie where ident=?";
PreparedStatement pstm = connection.prepareStatement(query);
pstm.setInt(1, id);
return pstm;
}
protected PreparedStatement prepareSelectStatement(Connection connection) throws SQLException {
String query = "SELECT * FROM Oddelenie";
PreparedStatement pstm = connection.prepareStatement(query);
return pstm;
}
protected Oddelenie createFromResultSet(ResultSet rs) throws SQLException {
Oddelenie object = new Oddelenie();
object.setNazov( rs.getString("nazov") );
object.setKod( rs.getString("kod") );
object.setPoschodie( rs.getInt("poschodie") );
return object;
}
@Override
protected void test(Oddelenie object) {
}
}
staci pouzit connectionPool.java
ConnectionPool cp = new ConnectionPool();
Connection conn = cp.acquire();
Constraint ::= (Length | DefaultValue | Regex | Range | Required)
DefaultValue ::= (<defaultvalue> <INT_VALUE>)
Entity ::= (<entity> <NAME> (<{> (Property (Property)*) <}>))
Length ::= (<length> <INT_VALUE> <INT_VALUE>)
Model ::= ((Entity)* (Reference)*)
Property ::= (<NAME> (<:> Type) ((Constraint ((<,> Constraint))*))?)
Range ::= (<range> <INT_VALUE> <INT_VALUE>)
Reference ::= (<reference> <NAME> <NAME>)
Regex ::= (<regex> <STRING_VALUE>)
Required ::= <required>
Type ::= (<INTEGER> | <REAL> | <STRING>)
public Reference[] getOutgoingReferences() {
Reference[] refs = new Reference[outgoingReferences.size()];
int i = 0;
for(Reference ref : outgoingReferences){
refs[i++] = ref;
}
return refs;
}
public Reference[] getOutgoingReferences() {
return (Reference[]) outgoingReferences.toArray(new Reference[outgoingReferences.size()]);
}
#set( $n = 1 )
#foreach($entity in $model.entities)
case $n:
new ${entity.name}Table().menu();
break;
#set( $n = $n + 1 )
#end
#if($!{component.entity})
#if($property.type == "INTEGER")
UIProcessor parserext = new UIProcessor(new FileReader("ui.xml"));
SchemaFactory schemaFactory=SchemaFactory.newInstance("[url=http://www.w3.org/2001/XMLSchema]http://www.w3.org/2001/XMLSchema[/url]");
Schema schema=schemaFactory.newSchema(new File("model/schema1.xsd"));
unmarshaller.setSchema(schema);
#set( $entity = ${model.findEntity($table.entityName)} )
#set( $name = $column.getPropertyName() )
#if(${entity.findProperty($name)})
#set( $property = ${entity.findProperty($name)} )
[PRE X>0 THEN y=y/xEND](y>1), [CHOICE SS:= SS U{xx} ||| bb:=TRUE OR bb:=FALSE ](xx patri SS)
[ANY vv WHERE vv>xx A vv (patri) N THEN xx:=vv END] (xx (patri) ss)
[@vv.(vv>xx a vv patri N -> xx:=vv)](xx patri ss)
pre vsetky vv: (vv>xx a vv patri N) -> [xx:=vv](xx patri ss)
pre vsetky vv: (vv>xx a vv patri N) -> vv patri ss
MACHINE Stroj()
VARIABLES ss
INVARIANT ss patri N
INITIALISATION ss=prazdna mnozina
OPERATIONS
b <- Test(xx) =
PRE xx patri N
THEN
IF xx patri ss THEN b := TRUE ELSE b:=FALSE END
END
b<- Nedeterm(xx) =
PRE xx patri N
THEN
CHOICE ss := ss zjednotenie {xx} || b:= TRUE OR b:=FALSE END
END
END
Quote from: scream on 06.01.2011, 00:02:09
Aky je rozdiel medzi ovalom a elipsou v tomto zadani?Lebo elipsa je oval... kruh je tiez oval...
void around(Object object) throws StackException: execution(public void push(..)) && (cflow(execution(* *.newCircle(..))) || cflow(execution(* *.newRectangle(..)))) && args(object){
try {
System.out.print(thisJoinPoint.getSignature()+": "+thisJoinPoint.getSourceLocation().getLine()+" ");
proceed(object);
} catch(StackException e) {
try {
System.out.print("ERROR: Stack1 is full! - ");
if(object instanceof Rectangle){
System.out.println("Rectangle");
tempStack.push((Rectangle)object);
}else if(object instanceof Circle){
System.out.println("Circle");
tempStack.push((Circle)object);
}
throw e;
} catch(StackException e2) {
System.out.print("ERROR: Stack2 is full! - ");
if(object instanceof Rectangle){
System.out.println("Rectangle");
}else if(object instanceof Circle){
System.out.println("Circle");
}
throw e2;
}
}
}