001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.NoSuchAccountException;
018    import com.liferay.portal.kernel.cache.CacheRegistryUtil;
019    import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
020    import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
021    import com.liferay.portal.kernel.dao.orm.FinderPath;
022    import com.liferay.portal.kernel.dao.orm.Query;
023    import com.liferay.portal.kernel.dao.orm.QueryUtil;
024    import com.liferay.portal.kernel.dao.orm.Session;
025    import com.liferay.portal.kernel.exception.SystemException;
026    import com.liferay.portal.kernel.log.Log;
027    import com.liferay.portal.kernel.log.LogFactoryUtil;
028    import com.liferay.portal.kernel.util.GetterUtil;
029    import com.liferay.portal.kernel.util.InstanceFactory;
030    import com.liferay.portal.kernel.util.OrderByComparator;
031    import com.liferay.portal.kernel.util.SetUtil;
032    import com.liferay.portal.kernel.util.StringBundler;
033    import com.liferay.portal.kernel.util.StringUtil;
034    import com.liferay.portal.kernel.util.UnmodifiableList;
035    import com.liferay.portal.model.Account;
036    import com.liferay.portal.model.CacheModel;
037    import com.liferay.portal.model.ModelListener;
038    import com.liferay.portal.model.impl.AccountImpl;
039    import com.liferay.portal.model.impl.AccountModelImpl;
040    import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
041    
042    import java.io.Serializable;
043    
044    import java.util.ArrayList;
045    import java.util.Collections;
046    import java.util.List;
047    import java.util.Set;
048    
049    /**
050     * The persistence implementation for the account service.
051     *
052     * <p>
053     * Caching information and settings can be found in <code>portal.properties</code>
054     * </p>
055     *
056     * @author Brian Wing Shun Chan
057     * @see AccountPersistence
058     * @see AccountUtil
059     * @generated
060     */
061    public class AccountPersistenceImpl extends BasePersistenceImpl<Account>
062            implements AccountPersistence {
063            /*
064             * NOTE FOR DEVELOPERS:
065             *
066             * Never modify or reference this class directly. Always use {@link AccountUtil} to access the account persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
067             */
068            public static final String FINDER_CLASS_NAME_ENTITY = AccountImpl.class.getName();
069            public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY +
070                    ".List1";
071            public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY +
072                    ".List2";
073            public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(AccountModelImpl.ENTITY_CACHE_ENABLED,
074                            AccountModelImpl.FINDER_CACHE_ENABLED, AccountImpl.class,
075                            FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
076            public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(AccountModelImpl.ENTITY_CACHE_ENABLED,
077                            AccountModelImpl.FINDER_CACHE_ENABLED, AccountImpl.class,
078                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
079            public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(AccountModelImpl.ENTITY_CACHE_ENABLED,
080                            AccountModelImpl.FINDER_CACHE_ENABLED, Long.class,
081                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
082    
083            /**
084             * Caches the account in the entity cache if it is enabled.
085             *
086             * @param account the account
087             */
088            @Override
089            public void cacheResult(Account account) {
090                    EntityCacheUtil.putResult(AccountModelImpl.ENTITY_CACHE_ENABLED,
091                            AccountImpl.class, account.getPrimaryKey(), account);
092    
093                    account.resetOriginalValues();
094            }
095    
096            /**
097             * Caches the accounts in the entity cache if it is enabled.
098             *
099             * @param accounts the accounts
100             */
101            @Override
102            public void cacheResult(List<Account> accounts) {
103                    for (Account account : accounts) {
104                            if (EntityCacheUtil.getResult(
105                                                    AccountModelImpl.ENTITY_CACHE_ENABLED,
106                                                    AccountImpl.class, account.getPrimaryKey()) == null) {
107                                    cacheResult(account);
108                            }
109                            else {
110                                    account.resetOriginalValues();
111                            }
112                    }
113            }
114    
115            /**
116             * Clears the cache for all accounts.
117             *
118             * <p>
119             * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
120             * </p>
121             */
122            @Override
123            public void clearCache() {
124                    if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
125                            CacheRegistryUtil.clear(AccountImpl.class.getName());
126                    }
127    
128                    EntityCacheUtil.clearCache(AccountImpl.class.getName());
129    
130                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
131                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
132                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
133            }
134    
135            /**
136             * Clears the cache for the account.
137             *
138             * <p>
139             * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
140             * </p>
141             */
142            @Override
143            public void clearCache(Account account) {
144                    EntityCacheUtil.removeResult(AccountModelImpl.ENTITY_CACHE_ENABLED,
145                            AccountImpl.class, account.getPrimaryKey());
146    
147                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
148                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
149            }
150    
151            @Override
152            public void clearCache(List<Account> accounts) {
153                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
154                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
155    
156                    for (Account account : accounts) {
157                            EntityCacheUtil.removeResult(AccountModelImpl.ENTITY_CACHE_ENABLED,
158                                    AccountImpl.class, account.getPrimaryKey());
159                    }
160            }
161    
162            /**
163             * Creates a new account with the primary key. Does not add the account to the database.
164             *
165             * @param accountId the primary key for the new account
166             * @return the new account
167             */
168            @Override
169            public Account create(long accountId) {
170                    Account account = new AccountImpl();
171    
172                    account.setNew(true);
173                    account.setPrimaryKey(accountId);
174    
175                    return account;
176            }
177    
178            /**
179             * Removes the account with the primary key from the database. Also notifies the appropriate model listeners.
180             *
181             * @param accountId the primary key of the account
182             * @return the account that was removed
183             * @throws com.liferay.portal.NoSuchAccountException if a account with the primary key could not be found
184             * @throws SystemException if a system exception occurred
185             */
186            @Override
187            public Account remove(long accountId)
188                    throws NoSuchAccountException, SystemException {
189                    return remove((Serializable)accountId);
190            }
191    
192            /**
193             * Removes the account with the primary key from the database. Also notifies the appropriate model listeners.
194             *
195             * @param primaryKey the primary key of the account
196             * @return the account that was removed
197             * @throws com.liferay.portal.NoSuchAccountException if a account with the primary key could not be found
198             * @throws SystemException if a system exception occurred
199             */
200            @Override
201            public Account remove(Serializable primaryKey)
202                    throws NoSuchAccountException, SystemException {
203                    Session session = null;
204    
205                    try {
206                            session = openSession();
207    
208                            Account account = (Account)session.get(AccountImpl.class, primaryKey);
209    
210                            if (account == null) {
211                                    if (_log.isWarnEnabled()) {
212                                            _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
213                                    }
214    
215                                    throw new NoSuchAccountException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
216                                            primaryKey);
217                            }
218    
219                            return remove(account);
220                    }
221                    catch (NoSuchAccountException nsee) {
222                            throw nsee;
223                    }
224                    catch (Exception e) {
225                            throw processException(e);
226                    }
227                    finally {
228                            closeSession(session);
229                    }
230            }
231    
232            @Override
233            protected Account removeImpl(Account account) throws SystemException {
234                    account = toUnwrappedModel(account);
235    
236                    Session session = null;
237    
238                    try {
239                            session = openSession();
240    
241                            if (!session.contains(account)) {
242                                    account = (Account)session.get(AccountImpl.class,
243                                                    account.getPrimaryKeyObj());
244                            }
245    
246                            if (account != null) {
247                                    session.delete(account);
248                            }
249                    }
250                    catch (Exception e) {
251                            throw processException(e);
252                    }
253                    finally {
254                            closeSession(session);
255                    }
256    
257                    if (account != null) {
258                            clearCache(account);
259                    }
260    
261                    return account;
262            }
263    
264            @Override
265            public Account updateImpl(com.liferay.portal.model.Account account)
266                    throws SystemException {
267                    account = toUnwrappedModel(account);
268    
269                    boolean isNew = account.isNew();
270    
271                    Session session = null;
272    
273                    try {
274                            session = openSession();
275    
276                            if (account.isNew()) {
277                                    session.save(account);
278    
279                                    account.setNew(false);
280                            }
281                            else {
282                                    session.merge(account);
283                            }
284                    }
285                    catch (Exception e) {
286                            throw processException(e);
287                    }
288                    finally {
289                            closeSession(session);
290                    }
291    
292                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
293    
294                    if (isNew) {
295                            FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
296                    }
297    
298                    EntityCacheUtil.putResult(AccountModelImpl.ENTITY_CACHE_ENABLED,
299                            AccountImpl.class, account.getPrimaryKey(), account);
300    
301                    return account;
302            }
303    
304            protected Account toUnwrappedModel(Account account) {
305                    if (account instanceof AccountImpl) {
306                            return account;
307                    }
308    
309                    AccountImpl accountImpl = new AccountImpl();
310    
311                    accountImpl.setNew(account.isNew());
312                    accountImpl.setPrimaryKey(account.getPrimaryKey());
313    
314                    accountImpl.setAccountId(account.getAccountId());
315                    accountImpl.setCompanyId(account.getCompanyId());
316                    accountImpl.setUserId(account.getUserId());
317                    accountImpl.setUserName(account.getUserName());
318                    accountImpl.setCreateDate(account.getCreateDate());
319                    accountImpl.setModifiedDate(account.getModifiedDate());
320                    accountImpl.setParentAccountId(account.getParentAccountId());
321                    accountImpl.setName(account.getName());
322                    accountImpl.setLegalName(account.getLegalName());
323                    accountImpl.setLegalId(account.getLegalId());
324                    accountImpl.setLegalType(account.getLegalType());
325                    accountImpl.setSicCode(account.getSicCode());
326                    accountImpl.setTickerSymbol(account.getTickerSymbol());
327                    accountImpl.setIndustry(account.getIndustry());
328                    accountImpl.setType(account.getType());
329                    accountImpl.setSize(account.getSize());
330    
331                    return accountImpl;
332            }
333    
334            /**
335             * Returns the account with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
336             *
337             * @param primaryKey the primary key of the account
338             * @return the account
339             * @throws com.liferay.portal.NoSuchAccountException if a account with the primary key could not be found
340             * @throws SystemException if a system exception occurred
341             */
342            @Override
343            public Account findByPrimaryKey(Serializable primaryKey)
344                    throws NoSuchAccountException, SystemException {
345                    Account account = fetchByPrimaryKey(primaryKey);
346    
347                    if (account == null) {
348                            if (_log.isWarnEnabled()) {
349                                    _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
350                            }
351    
352                            throw new NoSuchAccountException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
353                                    primaryKey);
354                    }
355    
356                    return account;
357            }
358    
359            /**
360             * Returns the account with the primary key or throws a {@link com.liferay.portal.NoSuchAccountException} if it could not be found.
361             *
362             * @param accountId the primary key of the account
363             * @return the account
364             * @throws com.liferay.portal.NoSuchAccountException if a account with the primary key could not be found
365             * @throws SystemException if a system exception occurred
366             */
367            @Override
368            public Account findByPrimaryKey(long accountId)
369                    throws NoSuchAccountException, SystemException {
370                    return findByPrimaryKey((Serializable)accountId);
371            }
372    
373            /**
374             * Returns the account with the primary key or returns <code>null</code> if it could not be found.
375             *
376             * @param primaryKey the primary key of the account
377             * @return the account, or <code>null</code> if a account with the primary key could not be found
378             * @throws SystemException if a system exception occurred
379             */
380            @Override
381            public Account fetchByPrimaryKey(Serializable primaryKey)
382                    throws SystemException {
383                    Account account = (Account)EntityCacheUtil.getResult(AccountModelImpl.ENTITY_CACHE_ENABLED,
384                                    AccountImpl.class, primaryKey);
385    
386                    if (account == _nullAccount) {
387                            return null;
388                    }
389    
390                    if (account == null) {
391                            Session session = null;
392    
393                            try {
394                                    session = openSession();
395    
396                                    account = (Account)session.get(AccountImpl.class, primaryKey);
397    
398                                    if (account != null) {
399                                            cacheResult(account);
400                                    }
401                                    else {
402                                            EntityCacheUtil.putResult(AccountModelImpl.ENTITY_CACHE_ENABLED,
403                                                    AccountImpl.class, primaryKey, _nullAccount);
404                                    }
405                            }
406                            catch (Exception e) {
407                                    EntityCacheUtil.removeResult(AccountModelImpl.ENTITY_CACHE_ENABLED,
408                                            AccountImpl.class, primaryKey);
409    
410                                    throw processException(e);
411                            }
412                            finally {
413                                    closeSession(session);
414                            }
415                    }
416    
417                    return account;
418            }
419    
420            /**
421             * Returns the account with the primary key or returns <code>null</code> if it could not be found.
422             *
423             * @param accountId the primary key of the account
424             * @return the account, or <code>null</code> if a account with the primary key could not be found
425             * @throws SystemException if a system exception occurred
426             */
427            @Override
428            public Account fetchByPrimaryKey(long accountId) throws SystemException {
429                    return fetchByPrimaryKey((Serializable)accountId);
430            }
431    
432            /**
433             * Returns all the accounts.
434             *
435             * @return the accounts
436             * @throws SystemException if a system exception occurred
437             */
438            @Override
439            public List<Account> findAll() throws SystemException {
440                    return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
441            }
442    
443            /**
444             * Returns a range of all the accounts.
445             *
446             * <p>
447             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.AccountModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
448             * </p>
449             *
450             * @param start the lower bound of the range of accounts
451             * @param end the upper bound of the range of accounts (not inclusive)
452             * @return the range of accounts
453             * @throws SystemException if a system exception occurred
454             */
455            @Override
456            public List<Account> findAll(int start, int end) throws SystemException {
457                    return findAll(start, end, null);
458            }
459    
460            /**
461             * Returns an ordered range of all the accounts.
462             *
463             * <p>
464             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.AccountModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
465             * </p>
466             *
467             * @param start the lower bound of the range of accounts
468             * @param end the upper bound of the range of accounts (not inclusive)
469             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
470             * @return the ordered range of accounts
471             * @throws SystemException if a system exception occurred
472             */
473            @Override
474            public List<Account> findAll(int start, int end,
475                    OrderByComparator orderByComparator) throws SystemException {
476                    boolean pagination = true;
477                    FinderPath finderPath = null;
478                    Object[] finderArgs = null;
479    
480                    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
481                                    (orderByComparator == null)) {
482                            pagination = false;
483                            finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
484                            finderArgs = FINDER_ARGS_EMPTY;
485                    }
486                    else {
487                            finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
488                            finderArgs = new Object[] { start, end, orderByComparator };
489                    }
490    
491                    List<Account> list = (List<Account>)FinderCacheUtil.getResult(finderPath,
492                                    finderArgs, this);
493    
494                    if (list == null) {
495                            StringBundler query = null;
496                            String sql = null;
497    
498                            if (orderByComparator != null) {
499                                    query = new StringBundler(2 +
500                                                    (orderByComparator.getOrderByFields().length * 3));
501    
502                                    query.append(_SQL_SELECT_ACCOUNT);
503    
504                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
505                                            orderByComparator);
506    
507                                    sql = query.toString();
508                            }
509                            else {
510                                    sql = _SQL_SELECT_ACCOUNT;
511    
512                                    if (pagination) {
513                                            sql = sql.concat(AccountModelImpl.ORDER_BY_JPQL);
514                                    }
515                            }
516    
517                            Session session = null;
518    
519                            try {
520                                    session = openSession();
521    
522                                    Query q = session.createQuery(sql);
523    
524                                    if (!pagination) {
525                                            list = (List<Account>)QueryUtil.list(q, getDialect(),
526                                                            start, end, false);
527    
528                                            Collections.sort(list);
529    
530                                            list = new UnmodifiableList<Account>(list);
531                                    }
532                                    else {
533                                            list = (List<Account>)QueryUtil.list(q, getDialect(),
534                                                            start, end);
535                                    }
536    
537                                    cacheResult(list);
538    
539                                    FinderCacheUtil.putResult(finderPath, finderArgs, list);
540                            }
541                            catch (Exception e) {
542                                    FinderCacheUtil.removeResult(finderPath, finderArgs);
543    
544                                    throw processException(e);
545                            }
546                            finally {
547                                    closeSession(session);
548                            }
549                    }
550    
551                    return list;
552            }
553    
554            /**
555             * Removes all the accounts from the database.
556             *
557             * @throws SystemException if a system exception occurred
558             */
559            @Override
560            public void removeAll() throws SystemException {
561                    for (Account account : findAll()) {
562                            remove(account);
563                    }
564            }
565    
566            /**
567             * Returns the number of accounts.
568             *
569             * @return the number of accounts
570             * @throws SystemException if a system exception occurred
571             */
572            @Override
573            public int countAll() throws SystemException {
574                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
575                                    FINDER_ARGS_EMPTY, this);
576    
577                    if (count == null) {
578                            Session session = null;
579    
580                            try {
581                                    session = openSession();
582    
583                                    Query q = session.createQuery(_SQL_COUNT_ACCOUNT);
584    
585                                    count = (Long)q.uniqueResult();
586    
587                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
588                                            FINDER_ARGS_EMPTY, count);
589                            }
590                            catch (Exception e) {
591                                    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_ALL,
592                                            FINDER_ARGS_EMPTY);
593    
594                                    throw processException(e);
595                            }
596                            finally {
597                                    closeSession(session);
598                            }
599                    }
600    
601                    return count.intValue();
602            }
603    
604            @Override
605            protected Set<String> getBadColumnNames() {
606                    return _badColumnNames;
607            }
608    
609            /**
610             * Initializes the account persistence.
611             */
612            public void afterPropertiesSet() {
613                    String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
614                                            com.liferay.portal.util.PropsUtil.get(
615                                                    "value.object.listener.com.liferay.portal.model.Account")));
616    
617                    if (listenerClassNames.length > 0) {
618                            try {
619                                    List<ModelListener<Account>> listenersList = new ArrayList<ModelListener<Account>>();
620    
621                                    for (String listenerClassName : listenerClassNames) {
622                                            listenersList.add((ModelListener<Account>)InstanceFactory.newInstance(
623                                                            getClassLoader(), listenerClassName));
624                                    }
625    
626                                    listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
627                            }
628                            catch (Exception e) {
629                                    _log.error(e);
630                            }
631                    }
632            }
633    
634            public void destroy() {
635                    EntityCacheUtil.removeCache(AccountImpl.class.getName());
636                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
637                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
638                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
639            }
640    
641            private static final String _SQL_SELECT_ACCOUNT = "SELECT account FROM Account account";
642            private static final String _SQL_COUNT_ACCOUNT = "SELECT COUNT(account) FROM Account account";
643            private static final String _ORDER_BY_ENTITY_ALIAS = "account.";
644            private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No Account exists with the primary key ";
645            private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = com.liferay.portal.util.PropsValues.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE;
646            private static Log _log = LogFactoryUtil.getLog(AccountPersistenceImpl.class);
647            private static Set<String> _badColumnNames = SetUtil.fromArray(new String[] {
648                                    "type", "size"
649                            });
650            private static Account _nullAccount = new AccountImpl() {
651                            @Override
652                            public Object clone() {
653                                    return this;
654                            }
655    
656                            @Override
657                            public CacheModel<Account> toCacheModel() {
658                                    return _nullAccountCacheModel;
659                            }
660                    };
661    
662            private static CacheModel<Account> _nullAccountCacheModel = new CacheModel<Account>() {
663                            @Override
664                            public Account toEntityModel() {
665                                    return _nullAccount;
666                            }
667                    };
668    }