
Persistence::Entity::Query - Database entity query.

SQL::Query
|
+----Persistence::Entity::Query

my $entity_manager = $class->new(connection_name => 'my_connection');
$entity_manager->add_entities(SQL::Entity->new(
name => 'emp',
unique_expression => 'empno',
columns => [
sql_column(name => 'ename'),
sql_column(name => 'empno'),
sql_column(name => 'deptno')
],
indexes => [
sql_index(name => 'emp_idx1', columns => ['empno'])
]
));
package Employee;
use Abstract::Meta::Class ':all';
use Persistence::ORM ':all';
entity 'emp';
column empno => has('$.no') ;
column ename => has('$.name');
column deptno => has('$.deptno');
my $query = $entity_manager->query(emp => 'Employee');
$query->set_offset(20);
$query->set_limit(5);
my @emp = $query->execute();
# do stuff $emp[0]->name
my $query = $entity_manager->query('emp');
$query->set_offset(20);
$query->set_limit(5);
my @emp = $query->execute();
# do stuff $emp[0]->{ename}

Represents database query based on entity definition.

None

SQL::Query Persistence::Entity

The Persistence::Entity::Query module is free software. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.

Adrian Witas, adrian@webapp.strefa.pl